/*
 *
 *    Copyright (c) 2021 Project CHIP Authors
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

// THIS FILE IS GENERATED BY ZAP

#pragma once

#include <cstdint>

#include "ModelCommand.h"
#include "gen/CHIPClientCallbacks.h"
#include "gen/CHIPClusters.h"
#include <lib/core/CHIPSafeCasts.h>

static void OnDefaultSuccessResponse(void * context)
{
    ChipLogProgress(chipTool, "Default Success Response");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDefaultFailureResponse(void * context, uint8_t status)
{
    ChipLogProgress(chipTool, "Default Failure Response: 0x%02x", status);

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_ERROR_INTERNAL);
}

static void OnBooleanAttributeResponse(void * context, bool value)
{
    ChipLogProgress(chipTool, "Boolean attribute Response: %d", value);

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnInt8uAttributeResponse(void * context, uint8_t value)
{
    ChipLogProgress(chipTool, "Int8u attribute Response: %" PRIu8, value);

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnInt16uAttributeResponse(void * context, uint16_t value)
{
    ChipLogProgress(chipTool, "Int16u attribute Response: %" PRIu16, value);

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnInt32uAttributeResponse(void * context, uint32_t value)
{
    ChipLogProgress(chipTool, "Int32u attribute Response: %" PRIu32, value);

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnInt64uAttributeResponse(void * context, uint64_t value)
{
    ChipLogProgress(chipTool, "Int64u attribute Response: %" PRIu64, value);

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnInt8sAttributeResponse(void * context, int8_t value)
{
    ChipLogProgress(chipTool, "Int8s attribute Response: %" PRId8, value);

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnInt16sAttributeResponse(void * context, int16_t value)
{
    ChipLogProgress(chipTool, "Int16s attribute Response: %" PRId16, value);

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnInt32sAttributeResponse(void * context, int32_t value)
{
    ChipLogProgress(chipTool, "Int32s attribute Response: %" PRId32, value);

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnInt64sAttributeResponse(void * context, int64_t value)
{
    ChipLogProgress(chipTool, "Int64s attribute Response: %" PRId64, value);

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnStringAttributeResponse(void * context, const chip::ByteSpan value)
{
    ChipLogProgress(chipTool, "String attribute Response: %zu", value.size());

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnAccountLoginClusterGetSetupPINResponse(void * context, uint8_t * setupPIN)
{
    ChipLogProgress(chipTool, "AccountLoginClusterGetSetupPINResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnApplicationLauncherClusterLaunchAppResponse(void * context, uint8_t * data)
{
    ChipLogProgress(chipTool, "ApplicationLauncherClusterLaunchAppResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnContentLauncherClusterLaunchContentResponse(void * context, uint8_t * data, uint8_t contentLaunchStatus)
{
    ChipLogProgress(chipTool, "ContentLauncherClusterLaunchContentResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnContentLauncherClusterLaunchURLResponse(void * context, uint8_t * data, uint8_t contentLaunchStatus)
{
    ChipLogProgress(chipTool, "ContentLauncherClusterLaunchURLResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDoorLockClusterClearAllPinsResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterClearAllPinsResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDoorLockClusterClearAllRfidsResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterClearAllRfidsResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDoorLockClusterClearHolidayScheduleResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterClearHolidayScheduleResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDoorLockClusterClearPinResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterClearPinResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDoorLockClusterClearRfidResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterClearRfidResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDoorLockClusterClearWeekdayScheduleResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterClearWeekdayScheduleResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDoorLockClusterClearYeardayScheduleResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterClearYeardayScheduleResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDoorLockClusterGetHolidayScheduleResponse(void * context, uint8_t scheduleId, uint32_t localStartTime,
                                                        uint32_t localEndTime, uint8_t operatingModeDuringHoliday)
{
    ChipLogProgress(chipTool, "DoorLockClusterGetHolidayScheduleResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDoorLockClusterGetLogRecordResponse(void * context, uint16_t logEntryId, uint32_t timestamp, uint8_t eventType,
                                                  uint8_t source, uint8_t eventIdOrAlarmCode, uint16_t userId, uint8_t * pin)
{
    ChipLogProgress(chipTool, "DoorLockClusterGetLogRecordResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDoorLockClusterGetPinResponse(void * context, uint16_t userId, uint8_t userStatus, uint8_t userType, uint8_t * pin)
{
    ChipLogProgress(chipTool, "DoorLockClusterGetPinResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDoorLockClusterGetRfidResponse(void * context, uint16_t userId, uint8_t userStatus, uint8_t userType, uint8_t * rfid)
{
    ChipLogProgress(chipTool, "DoorLockClusterGetRfidResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDoorLockClusterGetUserTypeResponse(void * context, uint16_t userId, uint8_t userType)
{
    ChipLogProgress(chipTool, "DoorLockClusterGetUserTypeResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDoorLockClusterGetWeekdayScheduleResponse(void * context, uint8_t scheduleId, uint16_t userId, uint8_t daysMask,
                                                        uint8_t startHour, uint8_t startMinute, uint8_t endHour, uint8_t endMinute)
{
    ChipLogProgress(chipTool, "DoorLockClusterGetWeekdayScheduleResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDoorLockClusterGetYeardayScheduleResponse(void * context, uint8_t scheduleId, uint16_t userId,
                                                        uint32_t localStartTime, uint32_t localEndTime)
{
    ChipLogProgress(chipTool, "DoorLockClusterGetYeardayScheduleResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDoorLockClusterLockDoorResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterLockDoorResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDoorLockClusterSetHolidayScheduleResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterSetHolidayScheduleResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDoorLockClusterSetPinResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterSetPinResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDoorLockClusterSetRfidResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterSetRfidResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDoorLockClusterSetUserTypeResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterSetUserTypeResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDoorLockClusterSetWeekdayScheduleResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterSetWeekdayScheduleResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDoorLockClusterSetYeardayScheduleResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterSetYeardayScheduleResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDoorLockClusterUnlockDoorResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterUnlockDoorResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDoorLockClusterUnlockWithTimeoutResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterUnlockWithTimeoutResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnGeneralCommissioningClusterArmFailSafeResponse(void * context, uint8_t errorCode, uint8_t * debugText)
{
    ChipLogProgress(chipTool, "GeneralCommissioningClusterArmFailSafeResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnGeneralCommissioningClusterCommissioningCompleteResponse(void * context, uint8_t errorCode, uint8_t * debugText)
{
    ChipLogProgress(chipTool, "GeneralCommissioningClusterCommissioningCompleteResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnGeneralCommissioningClusterSetRegulatoryConfigResponse(void * context, uint8_t errorCode, uint8_t * debugText)
{
    ChipLogProgress(chipTool, "GeneralCommissioningClusterSetRegulatoryConfigResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnGroupsClusterAddGroupResponse(void * context, uint16_t groupId)
{
    ChipLogProgress(chipTool, "GroupsClusterAddGroupResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnGroupsClusterGetGroupMembershipResponse(void * context, uint8_t capacity, uint8_t groupCount,
                                                      /* TYPE WARNING: array array defaults to */ uint8_t * groupList)
{
    ChipLogProgress(chipTool, "GroupsClusterGetGroupMembershipResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnGroupsClusterRemoveGroupResponse(void * context, uint16_t groupId)
{
    ChipLogProgress(chipTool, "GroupsClusterRemoveGroupResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnGroupsClusterViewGroupResponse(void * context, uint16_t groupId, uint8_t * groupName)
{
    ChipLogProgress(chipTool, "GroupsClusterViewGroupResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnIdentifyClusterIdentifyQueryResponse(void * context, uint16_t timeout)
{
    ChipLogProgress(chipTool, "IdentifyClusterIdentifyQueryResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnKeypadInputClusterSendKeyResponse(void * context)
{
    ChipLogProgress(chipTool, "KeypadInputClusterSendKeyResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnMediaPlaybackClusterMediaFastForwardResponse(void * context, uint8_t mediaPlaybackStatus)
{
    ChipLogProgress(chipTool, "MediaPlaybackClusterMediaFastForwardResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnMediaPlaybackClusterMediaNextResponse(void * context, uint8_t mediaPlaybackStatus)
{
    ChipLogProgress(chipTool, "MediaPlaybackClusterMediaNextResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnMediaPlaybackClusterMediaPauseResponse(void * context, uint8_t mediaPlaybackStatus)
{
    ChipLogProgress(chipTool, "MediaPlaybackClusterMediaPauseResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnMediaPlaybackClusterMediaPlayResponse(void * context, uint8_t mediaPlaybackStatus)
{
    ChipLogProgress(chipTool, "MediaPlaybackClusterMediaPlayResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnMediaPlaybackClusterMediaPreviousResponse(void * context, uint8_t mediaPlaybackStatus)
{
    ChipLogProgress(chipTool, "MediaPlaybackClusterMediaPreviousResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnMediaPlaybackClusterMediaRewindResponse(void * context, uint8_t mediaPlaybackStatus)
{
    ChipLogProgress(chipTool, "MediaPlaybackClusterMediaRewindResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnMediaPlaybackClusterMediaSeekResponse(void * context, uint8_t mediaPlaybackStatus)
{
    ChipLogProgress(chipTool, "MediaPlaybackClusterMediaSeekResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnMediaPlaybackClusterMediaSkipBackwardResponse(void * context, uint8_t mediaPlaybackStatus)
{
    ChipLogProgress(chipTool, "MediaPlaybackClusterMediaSkipBackwardResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnMediaPlaybackClusterMediaSkipForwardResponse(void * context, uint8_t mediaPlaybackStatus)
{
    ChipLogProgress(chipTool, "MediaPlaybackClusterMediaSkipForwardResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnMediaPlaybackClusterMediaStartOverResponse(void * context, uint8_t mediaPlaybackStatus)
{
    ChipLogProgress(chipTool, "MediaPlaybackClusterMediaStartOverResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnMediaPlaybackClusterMediaStopResponse(void * context, uint8_t mediaPlaybackStatus)
{
    ChipLogProgress(chipTool, "MediaPlaybackClusterMediaStopResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnNetworkCommissioningClusterAddThreadNetworkResponse(void * context, uint8_t errorCode, uint8_t * debugText)
{
    ChipLogProgress(chipTool, "NetworkCommissioningClusterAddThreadNetworkResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnNetworkCommissioningClusterAddWiFiNetworkResponse(void * context, uint8_t errorCode, uint8_t * debugText)
{
    ChipLogProgress(chipTool, "NetworkCommissioningClusterAddWiFiNetworkResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnNetworkCommissioningClusterDisableNetworkResponse(void * context, uint8_t errorCode, uint8_t * debugText)
{
    ChipLogProgress(chipTool, "NetworkCommissioningClusterDisableNetworkResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnNetworkCommissioningClusterEnableNetworkResponse(void * context, uint8_t errorCode, uint8_t * debugText)
{
    ChipLogProgress(chipTool, "NetworkCommissioningClusterEnableNetworkResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnNetworkCommissioningClusterRemoveNetworkResponse(void * context, uint8_t errorCode, uint8_t * debugText)
{
    ChipLogProgress(chipTool, "NetworkCommissioningClusterRemoveNetworkResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void
OnNetworkCommissioningClusterScanNetworksResponse(void * context, uint8_t errorCode, uint8_t * debugText,
                                                  /* TYPE WARNING: array array defaults to */ uint8_t * wifiScanResults,
                                                  /* TYPE WARNING: array array defaults to */ uint8_t * threadScanResults)
{
    ChipLogProgress(chipTool, "NetworkCommissioningClusterScanNetworksResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnNetworkCommissioningClusterUpdateThreadNetworkResponse(void * context, uint8_t errorCode, uint8_t * debugText)
{
    ChipLogProgress(chipTool, "NetworkCommissioningClusterUpdateThreadNetworkResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnNetworkCommissioningClusterUpdateWiFiNetworkResponse(void * context, uint8_t errorCode, uint8_t * debugText)
{
    ChipLogProgress(chipTool, "NetworkCommissioningClusterUpdateWiFiNetworkResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponse(void * context, uint8_t action, uint32_t delayedActionTime)
{
    ChipLogProgress(chipTool, "OtaSoftwareUpdateProviderClusterApplyUpdateRequestResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnOtaSoftwareUpdateProviderClusterQueryImageResponse(void * context, uint32_t delayedActionTime, uint8_t * imageURI,
                                                                 uint32_t softwareVersion, chip::ByteSpan updateToken,
                                                                 uint8_t userConsentNeeded, chip::ByteSpan metadataForRequestor)
{
    ChipLogProgress(chipTool, "OtaSoftwareUpdateProviderClusterQueryImageResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnOperationalCredentialsClusterOpCSRResponse(void * context, chip::ByteSpan CSR, chip::ByteSpan CSRNonce,
                                                         chip::ByteSpan VendorReserved1, chip::ByteSpan VendorReserved2,
                                                         chip::ByteSpan VendorReserved3, chip::ByteSpan Signature)
{
    ChipLogProgress(chipTool, "OperationalCredentialsClusterOpCSRResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnOperationalCredentialsClusterOpCertResponse(void * context, uint8_t StatusCode, uint64_t FabricIndex,
                                                          uint8_t * DebugText)
{
    ChipLogProgress(chipTool, "OperationalCredentialsClusterOpCertResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnOperationalCredentialsClusterSetFabricResponse(void * context, chip::FabricId FabricId)
{
    ChipLogProgress(chipTool, "OperationalCredentialsClusterSetFabricResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnScenesClusterAddSceneResponse(void * context, uint16_t groupId, uint8_t sceneId)
{
    ChipLogProgress(chipTool, "ScenesClusterAddSceneResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnScenesClusterGetSceneMembershipResponse(void * context, uint8_t capacity, uint16_t groupId, uint8_t sceneCount,
                                                      /* TYPE WARNING: array array defaults to */ uint8_t * sceneList)
{
    ChipLogProgress(chipTool, "ScenesClusterGetSceneMembershipResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnScenesClusterRemoveAllScenesResponse(void * context, uint16_t groupId)
{
    ChipLogProgress(chipTool, "ScenesClusterRemoveAllScenesResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnScenesClusterRemoveSceneResponse(void * context, uint16_t groupId, uint8_t sceneId)
{
    ChipLogProgress(chipTool, "ScenesClusterRemoveSceneResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnScenesClusterStoreSceneResponse(void * context, uint16_t groupId, uint8_t sceneId)
{
    ChipLogProgress(chipTool, "ScenesClusterStoreSceneResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnScenesClusterViewSceneResponse(void * context, uint16_t groupId, uint8_t sceneId, uint16_t transitionTime,
                                             uint8_t * sceneName,
                                             /* TYPE WARNING: array array defaults to */ uint8_t * extensionFieldSets)
{
    ChipLogProgress(chipTool, "ScenesClusterViewSceneResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnTvChannelClusterChangeChannelResponse(void * context,
                                                    /* TYPE WARNING: array array defaults to */ uint8_t * ChannelMatch,
                                                    uint8_t ErrorType)
{
    ChipLogProgress(chipTool, "TvChannelClusterChangeChannelResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnTargetNavigatorClusterNavigateTargetResponse(void * context, uint8_t * data)
{
    ChipLogProgress(chipTool, "TargetNavigatorClusterNavigateTargetResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnTestClusterClusterTestSpecificResponse(void * context, uint8_t returnValue)
{
    ChipLogProgress(chipTool, "TestClusterClusterTestSpecificResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnApplicationLauncherApplicationLauncherListListAttributeResponse(void * context, uint16_t count, uint16_t * entries)
{
    ChipLogProgress(chipTool, "OnApplicationLauncherApplicationLauncherListListAttributeResponse: %" PRIu16 " entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "INT16U[%" PRIu16 "]: %" PRIu16 "", i, entries[i]);
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnAudioOutputAudioOutputListListAttributeResponse(void * context, uint16_t count, _AudioOutputInfo * entries)
{
    ChipLogProgress(chipTool, "OnAudioOutputAudioOutputListListAttributeResponse: %" PRIu16 " entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "AudioOutputInfo[%" PRIu16 "]:", i);
        ChipLogProgress(chipTool, "  index: %" PRIu8 "", entries[i].index);
        ChipLogProgress(chipTool, "  outputType: %" PRIu8 "", entries[i].outputType);
        ChipLogProgress(Zcl, "  name: %zu", entries[i].name.size());
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnContentLauncherAcceptsHeaderListListAttributeResponse(void * context, uint16_t count, chip::ByteSpan * entries)
{
    ChipLogProgress(chipTool, "OnContentLauncherAcceptsHeaderListListAttributeResponse: %" PRIu16 " entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(Zcl, "  : %zu", entries[i].size());
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnContentLauncherSupportedStreamingTypesListAttributeResponse(void * context, uint16_t count, uint8_t * entries)
{
    ChipLogProgress(chipTool, "OnContentLauncherSupportedStreamingTypesListAttributeResponse: %" PRIu16 " entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "ContentLaunchStreamingType[%" PRIu16 "]: %" PRIu8 "", i, entries[i]);
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDescriptorDeviceListListAttributeResponse(void * context, uint16_t count, _DeviceType * entries)
{
    ChipLogProgress(chipTool, "OnDescriptorDeviceListListAttributeResponse: %" PRIu16 " entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "DeviceType[%" PRIu16 "]:", i);
        ChipLogProgress(chipTool, "  type: %" PRIu32 "", entries[i].type);
        ChipLogProgress(chipTool, "  revision: %" PRIu16 "", entries[i].revision);
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDescriptorServerListListAttributeResponse(void * context, uint16_t count, chip::ClusterId * entries)
{
    ChipLogProgress(chipTool, "OnDescriptorServerListListAttributeResponse: %" PRIu16 " entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "CLUSTER_ID[%" PRIu16 "]: %" PRIu32 "", i, entries[i]);
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDescriptorClientListListAttributeResponse(void * context, uint16_t count, chip::ClusterId * entries)
{
    ChipLogProgress(chipTool, "OnDescriptorClientListListAttributeResponse: %" PRIu16 " entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "CLUSTER_ID[%" PRIu16 "]: %" PRIu32 "", i, entries[i]);
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnDescriptorPartsListListAttributeResponse(void * context, uint16_t count, chip::EndpointId * entries)
{
    ChipLogProgress(chipTool, "OnDescriptorPartsListListAttributeResponse: %" PRIu16 " entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "ENDPOINT_NO[%" PRIu16 "]: %" PRIu16 "", i, entries[i]);
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnFixedLabelLabelListListAttributeResponse(void * context, uint16_t count, _LabelStruct * entries)
{
    ChipLogProgress(chipTool, "OnFixedLabelLabelListListAttributeResponse: %" PRIu16 " entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "LabelStruct[%" PRIu16 "]:", i);
        ChipLogProgress(Zcl, "  label: %zu", entries[i].label.size());
        ChipLogProgress(Zcl, "  value: %zu", entries[i].value.size());
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnGeneralDiagnosticsNetworkInterfacesListAttributeResponse(void * context, uint16_t count,
                                                                       _NetworkInterfaceType * entries)
{
    ChipLogProgress(chipTool, "OnGeneralDiagnosticsNetworkInterfacesListAttributeResponse: %" PRIu16 " entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "NetworkInterfaceType[%" PRIu16 "]:", i);
        ChipLogProgress(Zcl, "  Name: %zu", entries[i].Name.size());
        ChipLogProgress(chipTool, "  FabricConnected: %" PRIu8 "", entries[i].FabricConnected);
        ChipLogProgress(chipTool, "  OffPremiseServicesReachableIPv4: %" PRIu8 "", entries[i].OffPremiseServicesReachableIPv4);
        ChipLogProgress(chipTool, "  OffPremiseServicesReachableIPv6: %" PRIu8 "", entries[i].OffPremiseServicesReachableIPv6);
        ChipLogProgress(Zcl, "  HardwareAddress: %zu", entries[i].HardwareAddress.size());
        ChipLogProgress(chipTool, "  Type: %" PRIu8 "", entries[i].Type);
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnGroupKeyManagementGroupsListAttributeResponse(void * context, uint16_t count, _GroupState * entries)
{
    ChipLogProgress(chipTool, "OnGroupKeyManagementGroupsListAttributeResponse: %" PRIu16 " entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "GroupState[%" PRIu16 "]:", i);
        ChipLogProgress(chipTool, "  VendorId: %" PRIu16 "", entries[i].VendorId);
        ChipLogProgress(chipTool, "  VendorGroupId: %" PRIu16 "", entries[i].VendorGroupId);
        ChipLogProgress(chipTool, "  GroupKeySetIndex: %" PRIu16 "", entries[i].GroupKeySetIndex);
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnGroupKeyManagementGroupKeysListAttributeResponse(void * context, uint16_t count, _GroupKey * entries)
{
    ChipLogProgress(chipTool, "OnGroupKeyManagementGroupKeysListAttributeResponse: %" PRIu16 " entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "GroupKey[%" PRIu16 "]:", i);
        ChipLogProgress(chipTool, "  VendorId: %" PRIu16 "", entries[i].VendorId);
        ChipLogProgress(chipTool, "  GroupKeyIndex: %" PRIu16 "", entries[i].GroupKeyIndex);
        ChipLogProgress(Zcl, "  GroupKeyRoot: %zu", entries[i].GroupKeyRoot.size());
        ChipLogProgress(chipTool, "  GroupKeyEpochStartTime: %" PRIu64 "", entries[i].GroupKeyEpochStartTime);
        ChipLogProgress(chipTool, "  GroupKeySecurityPolicy: %" PRIu8 "", entries[i].GroupKeySecurityPolicy);
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnMediaInputMediaInputListListAttributeResponse(void * context, uint16_t count, _MediaInputInfo * entries)
{
    ChipLogProgress(chipTool, "OnMediaInputMediaInputListListAttributeResponse: %" PRIu16 " entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "MediaInputInfo[%" PRIu16 "]:", i);
        ChipLogProgress(chipTool, "  index: %" PRIu8 "", entries[i].index);
        ChipLogProgress(chipTool, "  inputType: %" PRIu8 "", entries[i].inputType);
        ChipLogProgress(Zcl, "  name: %zu", entries[i].name.size());
        ChipLogProgress(Zcl, "  description: %zu", entries[i].description.size());
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnOperationalCredentialsFabricsListListAttributeResponse(void * context, uint16_t count, _FabricDescriptor * entries)
{
    ChipLogProgress(chipTool, "OnOperationalCredentialsFabricsListListAttributeResponse: %" PRIu16 " entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "FabricDescriptor[%" PRIu16 "]:", i);
        ChipLogProgress(chipTool, "  FabricId: %" PRIu64 "", entries[i].FabricId);
        ChipLogProgress(chipTool, "  VendorId: %" PRIu16 "", entries[i].VendorId);
        ChipLogProgress(chipTool, "  NodeId: %" PRIu64 "", entries[i].NodeId);
        ChipLogProgress(Zcl, "  Label: %zu", entries[i].Label.size());
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnTvChannelTvChannelListListAttributeResponse(void * context, uint16_t count, _TvChannelInfo * entries)
{
    ChipLogProgress(chipTool, "OnTvChannelTvChannelListListAttributeResponse: %" PRIu16 " entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "TvChannelInfo[%" PRIu16 "]:", i);
        ChipLogProgress(chipTool, "  majorNumber: %" PRIu16 "", entries[i].majorNumber);
        ChipLogProgress(chipTool, "  minorNumber: %" PRIu16 "", entries[i].minorNumber);
        ChipLogProgress(Zcl, "  name: %zu", entries[i].name.size());
        ChipLogProgress(Zcl, "  callSign: %zu", entries[i].callSign.size());
        ChipLogProgress(Zcl, "  affiliateCallSign: %zu", entries[i].affiliateCallSign.size());
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnTargetNavigatorTargetNavigatorListListAttributeResponse(void * context, uint16_t count,
                                                                      _NavigateTargetTargetInfo * entries)
{
    ChipLogProgress(chipTool, "OnTargetNavigatorTargetNavigatorListListAttributeResponse: %" PRIu16 " entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "NavigateTargetTargetInfo[%" PRIu16 "]:", i);
        ChipLogProgress(chipTool, "  identifier: %" PRIu8 "", entries[i].identifier);
        ChipLogProgress(Zcl, "  name: %zu", entries[i].name.size());
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnTestClusterListInt8uListAttributeResponse(void * context, uint16_t count, uint8_t * entries)
{
    ChipLogProgress(chipTool, "OnTestClusterListInt8uListAttributeResponse: %" PRIu16 " entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "INT8U[%" PRIu16 "]: %" PRIu8 "", i, entries[i]);
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnTestClusterListOctetStringListAttributeResponse(void * context, uint16_t count, chip::ByteSpan * entries)
{
    ChipLogProgress(chipTool, "OnTestClusterListOctetStringListAttributeResponse: %" PRIu16 " entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(Zcl, "  : %zu", entries[i].size());
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnTestClusterListStructOctetStringListAttributeResponse(void * context, uint16_t count, _TestListStructOctet * entries)
{
    ChipLogProgress(chipTool, "OnTestClusterListStructOctetStringListAttributeResponse: %" PRIu16 " entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "TestListStructOctet[%" PRIu16 "]:", i);
        ChipLogProgress(chipTool, "  fabricIndex: %" PRIu64 "", entries[i].fabricIndex);
        ChipLogProgress(Zcl, "  operationalCert: %zu", entries[i].operationalCert.size());
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnThreadNetworkDiagnosticsNeighborTableListListAttributeResponse(void * context, uint16_t count,
                                                                             _NeighborTable * entries)
{
    ChipLogProgress(chipTool, "OnThreadNetworkDiagnosticsNeighborTableListListAttributeResponse: %" PRIu16 " entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "NeighborTable[%" PRIu16 "]:", i);
        ChipLogProgress(chipTool, "  ExtAddress: %" PRIu64 "", entries[i].ExtAddress);
        ChipLogProgress(chipTool, "  Age: %" PRIu32 "", entries[i].Age);
        ChipLogProgress(chipTool, "  Rloc16: %" PRIu16 "", entries[i].Rloc16);
        ChipLogProgress(chipTool, "  LinkFrameCounter: %" PRIu32 "", entries[i].LinkFrameCounter);
        ChipLogProgress(chipTool, "  MleFrameCounter: %" PRIu32 "", entries[i].MleFrameCounter);
        ChipLogProgress(chipTool, "  LQI: %" PRIu8 "", entries[i].LQI);
        ChipLogProgress(chipTool, "  AverageRssi: %" PRId8 "", entries[i].AverageRssi);
        ChipLogProgress(chipTool, "  LastRssi: %" PRId8 "", entries[i].LastRssi);
        ChipLogProgress(chipTool, "  FrameErrorRate: %" PRIu8 "", entries[i].FrameErrorRate);
        ChipLogProgress(chipTool, "  MessageErrorRate: %" PRIu8 "", entries[i].MessageErrorRate);
        ChipLogProgress(chipTool, "  RxOnWhenIdle: %" PRIu8 "", entries[i].RxOnWhenIdle);
        ChipLogProgress(chipTool, "  FullThreadDevice: %" PRIu8 "", entries[i].FullThreadDevice);
        ChipLogProgress(chipTool, "  FullNetworkData: %" PRIu8 "", entries[i].FullNetworkData);
        ChipLogProgress(chipTool, "  IsChild: %" PRIu8 "", entries[i].IsChild);
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnThreadNetworkDiagnosticsRouteTableListListAttributeResponse(void * context, uint16_t count, _RouteTable * entries)
{
    ChipLogProgress(chipTool, "OnThreadNetworkDiagnosticsRouteTableListListAttributeResponse: %" PRIu16 " entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "RouteTable[%" PRIu16 "]:", i);
        ChipLogProgress(chipTool, "  ExtAddress: %" PRIu64 "", entries[i].ExtAddress);
        ChipLogProgress(chipTool, "  Rloc16: %" PRIu16 "", entries[i].Rloc16);
        ChipLogProgress(chipTool, "  RouterId: %" PRIu8 "", entries[i].RouterId);
        ChipLogProgress(chipTool, "  NextHop: %" PRIu8 "", entries[i].NextHop);
        ChipLogProgress(chipTool, "  PathCost: %" PRIu8 "", entries[i].PathCost);
        ChipLogProgress(chipTool, "  LQIIn: %" PRIu8 "", entries[i].LQIIn);
        ChipLogProgress(chipTool, "  LQIOut: %" PRIu8 "", entries[i].LQIOut);
        ChipLogProgress(chipTool, "  Age: %" PRIu8 "", entries[i].Age);
        ChipLogProgress(chipTool, "  Allocated: %" PRIu8 "", entries[i].Allocated);
        ChipLogProgress(chipTool, "  LinkEstablished: %" PRIu8 "", entries[i].LinkEstablished);
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnThreadNetworkDiagnosticsSecurityPolicyListAttributeResponse(void * context, uint16_t count, _SecurityPolicy * entries)
{
    ChipLogProgress(chipTool, "OnThreadNetworkDiagnosticsSecurityPolicyListAttributeResponse: %" PRIu16 " entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "SecurityPolicy[%" PRIu16 "]:", i);
        ChipLogProgress(chipTool, "  RotationTime: %" PRIu16 "", entries[i].RotationTime);
        ChipLogProgress(chipTool, "  Flags: %" PRIu8 "", entries[i].Flags);
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnThreadNetworkDiagnosticsOperationalDatasetComponentsListAttributeResponse(void * context, uint16_t count,
                                                                                        _OperationalDatasetComponents * entries)
{
    ChipLogProgress(chipTool, "OnThreadNetworkDiagnosticsOperationalDatasetComponentsListAttributeResponse: %" PRIu16 " entries",
                    count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "OperationalDatasetComponents[%" PRIu16 "]:", i);
        ChipLogProgress(chipTool, "  ActiveTimestampPresent: %" PRIu8 "", entries[i].ActiveTimestampPresent);
        ChipLogProgress(chipTool, "  PendingTimestampPresent: %" PRIu8 "", entries[i].PendingTimestampPresent);
        ChipLogProgress(chipTool, "  MasterKeyPresent: %" PRIu8 "", entries[i].MasterKeyPresent);
        ChipLogProgress(chipTool, "  NetworkNamePresent: %" PRIu8 "", entries[i].NetworkNamePresent);
        ChipLogProgress(chipTool, "  ExtendedPanIdPresent: %" PRIu8 "", entries[i].ExtendedPanIdPresent);
        ChipLogProgress(chipTool, "  MeshLocalPrefixPresent: %" PRIu8 "", entries[i].MeshLocalPrefixPresent);
        ChipLogProgress(chipTool, "  DelayPresent: %" PRIu8 "", entries[i].DelayPresent);
        ChipLogProgress(chipTool, "  PanIdPresent: %" PRIu8 "", entries[i].PanIdPresent);
        ChipLogProgress(chipTool, "  ChannelPresent: %" PRIu8 "", entries[i].ChannelPresent);
        ChipLogProgress(chipTool, "  PskcPresent: %" PRIu8 "", entries[i].PskcPresent);
        ChipLogProgress(chipTool, "  SecurityPolicyPresent: %" PRIu8 "", entries[i].SecurityPolicyPresent);
        ChipLogProgress(chipTool, "  ChannelMaskPresent: %" PRIu8 "", entries[i].ChannelMaskPresent);
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

static void OnThreadNetworkDiagnosticsActiveNetworkFaultsListListAttributeResponse(void * context, uint16_t count,
                                                                                   uint8_t * entries)
{
    ChipLogProgress(chipTool, "OnThreadNetworkDiagnosticsActiveNetworkFaultsListListAttributeResponse: %" PRIu16 " entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "NetworkFault[%" PRIu16 "]: %" PRIu8 "", i, entries[i]);
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(CHIP_NO_ERROR);
}

/*----------------------------------------------------------------------------*\
| Cluster Name                                                        |   ID   |
|---------------------------------------------------------------------+--------|
| AccountLogin                                                        | 0x050E |
| ApplicationBasic                                                    | 0x050D |
| ApplicationLauncher                                                 | 0x050C |
| AudioOutput                                                         | 0x050B |
| BarrierControl                                                      | 0x0103 |
| Basic                                                               | 0x0028 |
| BinaryInputBasic                                                    | 0x000F |
| Binding                                                             | 0xF000 |
| BridgedDeviceBasic                                                  | 0x0039 |
| ColorControl                                                        | 0x0300 |
| ContentLauncher                                                     | 0x050A |
| Descriptor                                                          | 0x001D |
| DiagnosticLogs                                                      | 0x0032 |
| DoorLock                                                            | 0x0101 |
| ElectricalMeasurement                                               | 0x0B04 |
| EthernetNetworkDiagnostics                                          | 0x0037 |
| FixedLabel                                                          | 0x0040 |
| FlowMeasurement                                                     | 0x0404 |
| GeneralCommissioning                                                | 0x0030 |
| GeneralDiagnostics                                                  | 0x0033 |
| GroupKeyManagement                                                  | 0xF004 |
| Groups                                                              | 0x0004 |
| Identify                                                            | 0x0003 |
| KeypadInput                                                         | 0x0509 |
| LevelControl                                                        | 0x0008 |
| LowPower                                                            | 0x0508 |
| MediaInput                                                          | 0x0507 |
| MediaPlayback                                                       | 0x0506 |
| NetworkCommissioning                                                | 0x0031 |
| OtaSoftwareUpdateProvider                                           | 0x0029 |
| OccupancySensing                                                    | 0x0406 |
| OnOff                                                               | 0x0006 |
| OperationalCredentials                                              | 0x003E |
| PressureMeasurement                                                 | 0x0403 |
| PumpConfigurationAndControl                                         | 0x0200 |
| RelativeHumidityMeasurement                                         | 0x0405 |
| Scenes                                                              | 0x0005 |
| SoftwareDiagnostics                                                 | 0x0034 |
| Switch                                                              | 0x003B |
| TvChannel                                                           | 0x0504 |
| TargetNavigator                                                     | 0x0505 |
| TemperatureMeasurement                                              | 0x0402 |
| TestCluster                                                         | 0x050F |
| Thermostat                                                          | 0x0201 |
| ThreadNetworkDiagnostics                                            | 0x0035 |
| WakeOnLan                                                           | 0x0503 |
| WiFiNetworkDiagnostics                                              | 0x0036 |
| WindowCovering                                                      | 0x0102 |
\*----------------------------------------------------------------------------*/

constexpr chip::ClusterId kAccountLoginClusterId                = 0x050E;
constexpr chip::ClusterId kApplicationBasicClusterId            = 0x050D;
constexpr chip::ClusterId kApplicationLauncherClusterId         = 0x050C;
constexpr chip::ClusterId kAudioOutputClusterId                 = 0x050B;
constexpr chip::ClusterId kBarrierControlClusterId              = 0x0103;
constexpr chip::ClusterId kBasicClusterId                       = 0x0028;
constexpr chip::ClusterId kBinaryInputBasicClusterId            = 0x000F;
constexpr chip::ClusterId kBindingClusterId                     = 0xF000;
constexpr chip::ClusterId kBridgedDeviceBasicClusterId          = 0x0039;
constexpr chip::ClusterId kColorControlClusterId                = 0x0300;
constexpr chip::ClusterId kContentLauncherClusterId             = 0x050A;
constexpr chip::ClusterId kDescriptorClusterId                  = 0x001D;
constexpr chip::ClusterId kDiagnosticLogsClusterId              = 0x0032;
constexpr chip::ClusterId kDoorLockClusterId                    = 0x0101;
constexpr chip::ClusterId kElectricalMeasurementClusterId       = 0x0B04;
constexpr chip::ClusterId kEthernetNetworkDiagnosticsClusterId  = 0x0037;
constexpr chip::ClusterId kFixedLabelClusterId                  = 0x0040;
constexpr chip::ClusterId kFlowMeasurementClusterId             = 0x0404;
constexpr chip::ClusterId kGeneralCommissioningClusterId        = 0x0030;
constexpr chip::ClusterId kGeneralDiagnosticsClusterId          = 0x0033;
constexpr chip::ClusterId kGroupKeyManagementClusterId          = 0xF004;
constexpr chip::ClusterId kGroupsClusterId                      = 0x0004;
constexpr chip::ClusterId kIdentifyClusterId                    = 0x0003;
constexpr chip::ClusterId kKeypadInputClusterId                 = 0x0509;
constexpr chip::ClusterId kLevelControlClusterId                = 0x0008;
constexpr chip::ClusterId kLowPowerClusterId                    = 0x0508;
constexpr chip::ClusterId kMediaInputClusterId                  = 0x0507;
constexpr chip::ClusterId kMediaPlaybackClusterId               = 0x0506;
constexpr chip::ClusterId kNetworkCommissioningClusterId        = 0x0031;
constexpr chip::ClusterId kOtaSoftwareUpdateProviderClusterId   = 0x0029;
constexpr chip::ClusterId kOccupancySensingClusterId            = 0x0406;
constexpr chip::ClusterId kOnOffClusterId                       = 0x0006;
constexpr chip::ClusterId kOperationalCredentialsClusterId      = 0x003E;
constexpr chip::ClusterId kPressureMeasurementClusterId         = 0x0403;
constexpr chip::ClusterId kPumpConfigurationAndControlClusterId = 0x0200;
constexpr chip::ClusterId kRelativeHumidityMeasurementClusterId = 0x0405;
constexpr chip::ClusterId kScenesClusterId                      = 0x0005;
constexpr chip::ClusterId kSoftwareDiagnosticsClusterId         = 0x0034;
constexpr chip::ClusterId kSwitchClusterId                      = 0x003B;
constexpr chip::ClusterId kTvChannelClusterId                   = 0x0504;
constexpr chip::ClusterId kTargetNavigatorClusterId             = 0x0505;
constexpr chip::ClusterId kTemperatureMeasurementClusterId      = 0x0402;
constexpr chip::ClusterId kTestClusterClusterId                 = 0x050F;
constexpr chip::ClusterId kThermostatClusterId                  = 0x0201;
constexpr chip::ClusterId kThreadNetworkDiagnosticsClusterId    = 0x0035;
constexpr chip::ClusterId kWakeOnLanClusterId                   = 0x0503;
constexpr chip::ClusterId kWiFiNetworkDiagnosticsClusterId      = 0x0036;
constexpr chip::ClusterId kWindowCoveringClusterId              = 0x0102;

/*----------------------------------------------------------------------------*\
| Cluster AccountLogin                                                | 0x050E |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * GetSetupPIN                                                       |   0x00 |
| * Login                                                             |   0x01 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command GetSetupPIN
 */
class AccountLoginGetSetupPIN : public ModelCommand
{
public:
    AccountLoginGetSetupPIN() : ModelCommand("get-setup-pin")
    {
        AddArgument("TempAccountIdentifier", &mTempAccountIdentifier);
        ModelCommand::AddArguments();
    }
    ~AccountLoginGetSetupPIN()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050E) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::AccountLoginCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetSetupPIN(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                   chip::ByteSpan(chip::Uint8::from_char(mTempAccountIdentifier), strlen(mTempAccountIdentifier)));
    }

private:
    chip::Callback::Callback<AccountLoginClusterGetSetupPINResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<AccountLoginClusterGetSetupPINResponseCallback>(OnAccountLoginClusterGetSetupPINResponse,
                                                                                     this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mTempAccountIdentifier;
};

/*
 * Command Login
 */
class AccountLoginLogin : public ModelCommand
{
public:
    AccountLoginLogin() : ModelCommand("login")
    {
        AddArgument("TempAccountIdentifier", &mTempAccountIdentifier);
        AddArgument("SetupPIN", &mSetupPIN);
        ModelCommand::AddArguments();
    }
    ~AccountLoginLogin()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050E) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::AccountLoginCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.Login(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                             chip::ByteSpan(chip::Uint8::from_char(mTempAccountIdentifier), strlen(mTempAccountIdentifier)),
                             chip::ByteSpan(chip::Uint8::from_char(mSetupPIN), strlen(mSetupPIN)));
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mTempAccountIdentifier;
    char * mSetupPIN;
};

/*
 * Discover Attributes
 */
class DiscoverAccountLoginAttributes : public ModelCommand
{
public:
    DiscoverAccountLoginAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverAccountLoginAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::AccountLoginCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadAccountLoginClusterRevision : public ModelCommand
{
public:
    ReadAccountLoginClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadAccountLoginClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050E) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::AccountLoginCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster ApplicationBasic                                            | 0x050D |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * ChangeStatus                                                      |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * VendorName                                                        | 0x0000 |
| * VendorId                                                          | 0x0001 |
| * ApplicationName                                                   | 0x0002 |
| * ProductId                                                         | 0x0003 |
| * ApplicationId                                                     | 0x0005 |
| * CatalogVendorId                                                   | 0x0006 |
| * ApplicationStatus                                                 | 0x0007 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command ChangeStatus
 */
class ApplicationBasicChangeStatus : public ModelCommand
{
public:
    ApplicationBasicChangeStatus() : ModelCommand("change-status")
    {
        AddArgument("Status", 0, UINT8_MAX, &mStatus);
        ModelCommand::AddArguments();
    }
    ~ApplicationBasicChangeStatus()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ApplicationBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ChangeStatus(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStatus);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mStatus;
};

/*
 * Discover Attributes
 */
class DiscoverApplicationBasicAttributes : public ModelCommand
{
public:
    DiscoverApplicationBasicAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverApplicationBasicAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::ApplicationBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute VendorName
 */
class ReadApplicationBasicVendorName : public ModelCommand
{
public:
    ReadApplicationBasicVendorName() : ModelCommand("read")
    {
        AddArgument("attr-name", "vendor-name");
        ModelCommand::AddArguments();
    }

    ~ReadApplicationBasicVendorName()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ApplicationBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeVendorName(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute VendorId
 */
class ReadApplicationBasicVendorId : public ModelCommand
{
public:
    ReadApplicationBasicVendorId() : ModelCommand("read")
    {
        AddArgument("attr-name", "vendor-id");
        ModelCommand::AddArguments();
    }

    ~ReadApplicationBasicVendorId()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ApplicationBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeVendorId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ApplicationName
 */
class ReadApplicationBasicApplicationName : public ModelCommand
{
public:
    ReadApplicationBasicApplicationName() : ModelCommand("read")
    {
        AddArgument("attr-name", "application-name");
        ModelCommand::AddArguments();
    }

    ~ReadApplicationBasicApplicationName()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ApplicationBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeApplicationName(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ProductId
 */
class ReadApplicationBasicProductId : public ModelCommand
{
public:
    ReadApplicationBasicProductId() : ModelCommand("read")
    {
        AddArgument("attr-name", "product-id");
        ModelCommand::AddArguments();
    }

    ~ReadApplicationBasicProductId()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ApplicationBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeProductId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ApplicationId
 */
class ReadApplicationBasicApplicationId : public ModelCommand
{
public:
    ReadApplicationBasicApplicationId() : ModelCommand("read")
    {
        AddArgument("attr-name", "application-id");
        ModelCommand::AddArguments();
    }

    ~ReadApplicationBasicApplicationId()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ApplicationBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeApplicationId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CatalogVendorId
 */
class ReadApplicationBasicCatalogVendorId : public ModelCommand
{
public:
    ReadApplicationBasicCatalogVendorId() : ModelCommand("read")
    {
        AddArgument("attr-name", "catalog-vendor-id");
        ModelCommand::AddArguments();
    }

    ~ReadApplicationBasicCatalogVendorId()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ApplicationBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCatalogVendorId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ApplicationStatus
 */
class ReadApplicationBasicApplicationStatus : public ModelCommand
{
public:
    ReadApplicationBasicApplicationStatus() : ModelCommand("read")
    {
        AddArgument("attr-name", "application-status");
        ModelCommand::AddArguments();
    }

    ~ReadApplicationBasicApplicationStatus()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ApplicationBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeApplicationStatus(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadApplicationBasicClusterRevision : public ModelCommand
{
public:
    ReadApplicationBasicClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadApplicationBasicClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ApplicationBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster ApplicationLauncher                                         | 0x050C |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * LaunchApp                                                         |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * ApplicationLauncherList                                           | 0x0000 |
| * CatalogVendorId                                                   | 0x0001 |
| * ApplicationId                                                     | 0x0002 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command LaunchApp
 */
class ApplicationLauncherLaunchApp : public ModelCommand
{
public:
    ApplicationLauncherLaunchApp() : ModelCommand("launch-app")
    {
        AddArgument("Data", &mData);
        AddArgument("CatalogVendorId", 0, UINT16_MAX, &mCatalogVendorId);
        AddArgument("ApplicationId", &mApplicationId);
        ModelCommand::AddArguments();
    }
    ~ApplicationLauncherLaunchApp()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050C) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ApplicationLauncherCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.LaunchApp(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                 chip::ByteSpan(chip::Uint8::from_char(mData), strlen(mData)), mCatalogVendorId,
                                 chip::ByteSpan(chip::Uint8::from_char(mApplicationId), strlen(mApplicationId)));
    }

private:
    chip::Callback::Callback<ApplicationLauncherClusterLaunchAppResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<ApplicationLauncherClusterLaunchAppResponseCallback>(
            OnApplicationLauncherClusterLaunchAppResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mData;
    uint16_t mCatalogVendorId;
    char * mApplicationId;
};

/*
 * Discover Attributes
 */
class DiscoverApplicationLauncherAttributes : public ModelCommand
{
public:
    DiscoverApplicationLauncherAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverApplicationLauncherAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::ApplicationLauncherCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ApplicationLauncherList
 */
class ReadApplicationLauncherApplicationLauncherList : public ModelCommand
{
public:
    ReadApplicationLauncherApplicationLauncherList() : ModelCommand("read")
    {
        AddArgument("attr-name", "application-launcher-list");
        ModelCommand::AddArguments();
    }

    ~ReadApplicationLauncherApplicationLauncherList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050C) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ApplicationLauncherCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeApplicationLauncherList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<ApplicationLauncherApplicationLauncherListListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<ApplicationLauncherApplicationLauncherListListAttributeCallback>(
            OnApplicationLauncherApplicationLauncherListListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CatalogVendorId
 */
class ReadApplicationLauncherCatalogVendorId : public ModelCommand
{
public:
    ReadApplicationLauncherCatalogVendorId() : ModelCommand("read")
    {
        AddArgument("attr-name", "catalog-vendor-id");
        ModelCommand::AddArguments();
    }

    ~ReadApplicationLauncherCatalogVendorId()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050C) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ApplicationLauncherCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCatalogVendorId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ApplicationId
 */
class ReadApplicationLauncherApplicationId : public ModelCommand
{
public:
    ReadApplicationLauncherApplicationId() : ModelCommand("read")
    {
        AddArgument("attr-name", "application-id");
        ModelCommand::AddArguments();
    }

    ~ReadApplicationLauncherApplicationId()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050C) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ApplicationLauncherCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeApplicationId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadApplicationLauncherClusterRevision : public ModelCommand
{
public:
    ReadApplicationLauncherClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadApplicationLauncherClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050C) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ApplicationLauncherCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster AudioOutput                                                 | 0x050B |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * RenameOutput                                                      |   0x01 |
| * SelectOutput                                                      |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * AudioOutputList                                                   | 0x0000 |
| * CurrentAudioOutput                                                | 0x0001 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command RenameOutput
 */
class AudioOutputRenameOutput : public ModelCommand
{
public:
    AudioOutputRenameOutput() : ModelCommand("rename-output")
    {
        AddArgument("Index", 0, UINT8_MAX, &mIndex);
        AddArgument("Name", &mName);
        ModelCommand::AddArguments();
    }
    ~AudioOutputRenameOutput()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050B) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::AudioOutputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.RenameOutput(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mIndex,
                                    chip::ByteSpan(chip::Uint8::from_char(mName), strlen(mName)));
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mIndex;
    char * mName;
};

/*
 * Command SelectOutput
 */
class AudioOutputSelectOutput : public ModelCommand
{
public:
    AudioOutputSelectOutput() : ModelCommand("select-output")
    {
        AddArgument("Index", 0, UINT8_MAX, &mIndex);
        ModelCommand::AddArguments();
    }
    ~AudioOutputSelectOutput()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050B) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::AudioOutputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SelectOutput(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mIndex);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mIndex;
};

/*
 * Discover Attributes
 */
class DiscoverAudioOutputAttributes : public ModelCommand
{
public:
    DiscoverAudioOutputAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverAudioOutputAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::AudioOutputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute AudioOutputList
 */
class ReadAudioOutputAudioOutputList : public ModelCommand
{
public:
    ReadAudioOutputAudioOutputList() : ModelCommand("read")
    {
        AddArgument("attr-name", "audio-output-list");
        ModelCommand::AddArguments();
    }

    ~ReadAudioOutputAudioOutputList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050B) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::AudioOutputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeAudioOutputList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<AudioOutputAudioOutputListListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<AudioOutputAudioOutputListListAttributeCallback>(
            OnAudioOutputAudioOutputListListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CurrentAudioOutput
 */
class ReadAudioOutputCurrentAudioOutput : public ModelCommand
{
public:
    ReadAudioOutputCurrentAudioOutput() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-audio-output");
        ModelCommand::AddArguments();
    }

    ~ReadAudioOutputCurrentAudioOutput()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050B) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::AudioOutputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentAudioOutput(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadAudioOutputClusterRevision : public ModelCommand
{
public:
    ReadAudioOutputClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadAudioOutputClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050B) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::AudioOutputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster BarrierControl                                              | 0x0103 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * BarrierControlGoToPercent                                         |   0x00 |
| * BarrierControlStop                                                |   0x01 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * BarrierMovingState                                                | 0x0001 |
| * BarrierSafetyStatus                                               | 0x0002 |
| * BarrierCapabilities                                               | 0x0003 |
| * BarrierPosition                                                   | 0x000A |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command BarrierControlGoToPercent
 */
class BarrierControlBarrierControlGoToPercent : public ModelCommand
{
public:
    BarrierControlBarrierControlGoToPercent() : ModelCommand("barrier-control-go-to-percent")
    {
        AddArgument("PercentOpen", 0, UINT8_MAX, &mPercentOpen);
        ModelCommand::AddArguments();
    }
    ~BarrierControlBarrierControlGoToPercent()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BarrierControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.BarrierControlGoToPercent(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mPercentOpen);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mPercentOpen;
};

/*
 * Command BarrierControlStop
 */
class BarrierControlBarrierControlStop : public ModelCommand
{
public:
    BarrierControlBarrierControlStop() : ModelCommand("barrier-control-stop") { ModelCommand::AddArguments(); }
    ~BarrierControlBarrierControlStop()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::BarrierControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.BarrierControlStop(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Discover Attributes
 */
class DiscoverBarrierControlAttributes : public ModelCommand
{
public:
    DiscoverBarrierControlAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverBarrierControlAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::BarrierControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute BarrierMovingState
 */
class ReadBarrierControlBarrierMovingState : public ModelCommand
{
public:
    ReadBarrierControlBarrierMovingState() : ModelCommand("read")
    {
        AddArgument("attr-name", "barrier-moving-state");
        ModelCommand::AddArguments();
    }

    ~ReadBarrierControlBarrierMovingState()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BarrierControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeBarrierMovingState(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute BarrierSafetyStatus
 */
class ReadBarrierControlBarrierSafetyStatus : public ModelCommand
{
public:
    ReadBarrierControlBarrierSafetyStatus() : ModelCommand("read")
    {
        AddArgument("attr-name", "barrier-safety-status");
        ModelCommand::AddArguments();
    }

    ~ReadBarrierControlBarrierSafetyStatus()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BarrierControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeBarrierSafetyStatus(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute BarrierCapabilities
 */
class ReadBarrierControlBarrierCapabilities : public ModelCommand
{
public:
    ReadBarrierControlBarrierCapabilities() : ModelCommand("read")
    {
        AddArgument("attr-name", "barrier-capabilities");
        ModelCommand::AddArguments();
    }

    ~ReadBarrierControlBarrierCapabilities()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BarrierControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeBarrierCapabilities(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute BarrierPosition
 */
class ReadBarrierControlBarrierPosition : public ModelCommand
{
public:
    ReadBarrierControlBarrierPosition() : ModelCommand("read")
    {
        AddArgument("attr-name", "barrier-position");
        ModelCommand::AddArguments();
    }

    ~ReadBarrierControlBarrierPosition()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BarrierControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeBarrierPosition(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadBarrierControlClusterRevision : public ModelCommand
{
public:
    ReadBarrierControlClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadBarrierControlClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BarrierControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster Basic                                                       | 0x0028 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * MfgSpecificPing                                                   |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * InteractionModelVersion                                           | 0x0000 |
| * VendorName                                                        | 0x0001 |
| * VendorID                                                          | 0x0002 |
| * ProductName                                                       | 0x0003 |
| * ProductID                                                         | 0x0004 |
| * UserLabel                                                         | 0x0005 |
| * Location                                                          | 0x0006 |
| * HardwareVersion                                                   | 0x0007 |
| * HardwareVersionString                                             | 0x0008 |
| * SoftwareVersion                                                   | 0x0009 |
| * SoftwareVersionString                                             | 0x000A |
| * ManufacturingDate                                                 | 0x000B |
| * PartNumber                                                        | 0x000C |
| * ProductURL                                                        | 0x000D |
| * ProductLabel                                                      | 0x000E |
| * SerialNumber                                                      | 0x000F |
| * LocalConfigDisabled                                               | 0x0010 |
| * Reachable                                                         | 0x0011 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command MfgSpecificPing
 */
class BasicMfgSpecificPing : public ModelCommand
{
public:
    BasicMfgSpecificPing() : ModelCommand("mfg-specific-ping") { ModelCommand::AddArguments(); }
    ~BasicMfgSpecificPing()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MfgSpecificPing(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Discover Attributes
 */
class DiscoverBasicAttributes : public ModelCommand
{
public:
    DiscoverBasicAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverBasicAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute InteractionModelVersion
 */
class ReadBasicInteractionModelVersion : public ModelCommand
{
public:
    ReadBasicInteractionModelVersion() : ModelCommand("read")
    {
        AddArgument("attr-name", "interaction-model-version");
        ModelCommand::AddArguments();
    }

    ~ReadBasicInteractionModelVersion()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeInteractionModelVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute VendorName
 */
class ReadBasicVendorName : public ModelCommand
{
public:
    ReadBasicVendorName() : ModelCommand("read")
    {
        AddArgument("attr-name", "vendor-name");
        ModelCommand::AddArguments();
    }

    ~ReadBasicVendorName()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeVendorName(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute VendorID
 */
class ReadBasicVendorID : public ModelCommand
{
public:
    ReadBasicVendorID() : ModelCommand("read")
    {
        AddArgument("attr-name", "vendor-id");
        ModelCommand::AddArguments();
    }

    ~ReadBasicVendorID()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeVendorID(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ProductName
 */
class ReadBasicProductName : public ModelCommand
{
public:
    ReadBasicProductName() : ModelCommand("read")
    {
        AddArgument("attr-name", "product-name");
        ModelCommand::AddArguments();
    }

    ~ReadBasicProductName()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeProductName(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ProductID
 */
class ReadBasicProductID : public ModelCommand
{
public:
    ReadBasicProductID() : ModelCommand("read")
    {
        AddArgument("attr-name", "product-id");
        ModelCommand::AddArguments();
    }

    ~ReadBasicProductID()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeProductID(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute UserLabel
 */
class ReadBasicUserLabel : public ModelCommand
{
public:
    ReadBasicUserLabel() : ModelCommand("read")
    {
        AddArgument("attr-name", "user-label");
        ModelCommand::AddArguments();
    }

    ~ReadBasicUserLabel()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeUserLabel(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteBasicUserLabel : public ModelCommand
{
public:
    WriteBasicUserLabel() : ModelCommand("write")
    {
        AddArgument("attr-name", "user-label");
        AddArgument("attr-value", &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteBasicUserLabel()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeUserLabel(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                               chip::ByteSpan(chip::Uint8::from_char(mValue), strlen(mValue)));
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mValue;
};

/*
 * Attribute Location
 */
class ReadBasicLocation : public ModelCommand
{
public:
    ReadBasicLocation() : ModelCommand("read")
    {
        AddArgument("attr-name", "location");
        ModelCommand::AddArguments();
    }

    ~ReadBasicLocation()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeLocation(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteBasicLocation : public ModelCommand
{
public:
    WriteBasicLocation() : ModelCommand("write")
    {
        AddArgument("attr-name", "location");
        AddArgument("attr-value", &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteBasicLocation()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeLocation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                              chip::ByteSpan(chip::Uint8::from_char(mValue), strlen(mValue)));
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mValue;
};

/*
 * Attribute HardwareVersion
 */
class ReadBasicHardwareVersion : public ModelCommand
{
public:
    ReadBasicHardwareVersion() : ModelCommand("read")
    {
        AddArgument("attr-name", "hardware-version");
        ModelCommand::AddArguments();
    }

    ~ReadBasicHardwareVersion()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeHardwareVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute HardwareVersionString
 */
class ReadBasicHardwareVersionString : public ModelCommand
{
public:
    ReadBasicHardwareVersionString() : ModelCommand("read")
    {
        AddArgument("attr-name", "hardware-version-string");
        ModelCommand::AddArguments();
    }

    ~ReadBasicHardwareVersionString()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeHardwareVersionString(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute SoftwareVersion
 */
class ReadBasicSoftwareVersion : public ModelCommand
{
public:
    ReadBasicSoftwareVersion() : ModelCommand("read")
    {
        AddArgument("attr-name", "software-version");
        ModelCommand::AddArguments();
    }

    ~ReadBasicSoftwareVersion()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeSoftwareVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute SoftwareVersionString
 */
class ReadBasicSoftwareVersionString : public ModelCommand
{
public:
    ReadBasicSoftwareVersionString() : ModelCommand("read")
    {
        AddArgument("attr-name", "software-version-string");
        ModelCommand::AddArguments();
    }

    ~ReadBasicSoftwareVersionString()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeSoftwareVersionString(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ManufacturingDate
 */
class ReadBasicManufacturingDate : public ModelCommand
{
public:
    ReadBasicManufacturingDate() : ModelCommand("read")
    {
        AddArgument("attr-name", "manufacturing-date");
        ModelCommand::AddArguments();
    }

    ~ReadBasicManufacturingDate()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeManufacturingDate(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute PartNumber
 */
class ReadBasicPartNumber : public ModelCommand
{
public:
    ReadBasicPartNumber() : ModelCommand("read")
    {
        AddArgument("attr-name", "part-number");
        ModelCommand::AddArguments();
    }

    ~ReadBasicPartNumber()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePartNumber(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ProductURL
 */
class ReadBasicProductURL : public ModelCommand
{
public:
    ReadBasicProductURL() : ModelCommand("read")
    {
        AddArgument("attr-name", "product-url");
        ModelCommand::AddArguments();
    }

    ~ReadBasicProductURL()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeProductURL(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ProductLabel
 */
class ReadBasicProductLabel : public ModelCommand
{
public:
    ReadBasicProductLabel() : ModelCommand("read")
    {
        AddArgument("attr-name", "product-label");
        ModelCommand::AddArguments();
    }

    ~ReadBasicProductLabel()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeProductLabel(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute SerialNumber
 */
class ReadBasicSerialNumber : public ModelCommand
{
public:
    ReadBasicSerialNumber() : ModelCommand("read")
    {
        AddArgument("attr-name", "serial-number");
        ModelCommand::AddArguments();
    }

    ~ReadBasicSerialNumber()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeSerialNumber(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute LocalConfigDisabled
 */
class ReadBasicLocalConfigDisabled : public ModelCommand
{
public:
    ReadBasicLocalConfigDisabled() : ModelCommand("read")
    {
        AddArgument("attr-name", "local-config-disabled");
        ModelCommand::AddArguments();
    }

    ~ReadBasicLocalConfigDisabled()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeLocalConfigDisabled(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<BooleanAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteBasicLocalConfigDisabled : public ModelCommand
{
public:
    WriteBasicLocalConfigDisabled() : ModelCommand("write")
    {
        AddArgument("attr-name", "local-config-disabled");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteBasicLocalConfigDisabled()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeLocalConfigDisabled(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute Reachable
 */
class ReadBasicReachable : public ModelCommand
{
public:
    ReadBasicReachable() : ModelCommand("read")
    {
        AddArgument("attr-name", "reachable");
        ModelCommand::AddArguments();
    }

    ~ReadBasicReachable()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeReachable(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<BooleanAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadBasicClusterRevision : public ModelCommand
{
public:
    ReadBasicClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadBasicClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster BinaryInputBasic                                            | 0x000F |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * OutOfService                                                      | 0x0051 |
| * PresentValue                                                      | 0x0055 |
| * StatusFlags                                                       | 0x006F |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Discover Attributes
 */
class DiscoverBinaryInputBasicAttributes : public ModelCommand
{
public:
    DiscoverBinaryInputBasicAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverBinaryInputBasicAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::BinaryInputBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute OutOfService
 */
class ReadBinaryInputBasicOutOfService : public ModelCommand
{
public:
    ReadBinaryInputBasicOutOfService() : ModelCommand("read")
    {
        AddArgument("attr-name", "out-of-service");
        ModelCommand::AddArguments();
    }

    ~ReadBinaryInputBasicOutOfService()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x000F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BinaryInputBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeOutOfService(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<BooleanAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteBinaryInputBasicOutOfService : public ModelCommand
{
public:
    WriteBinaryInputBasicOutOfService() : ModelCommand("write")
    {
        AddArgument("attr-name", "out-of-service");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteBinaryInputBasicOutOfService()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x000F) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::BinaryInputBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeOutOfService(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute PresentValue
 */
class ReadBinaryInputBasicPresentValue : public ModelCommand
{
public:
    ReadBinaryInputBasicPresentValue() : ModelCommand("read")
    {
        AddArgument("attr-name", "present-value");
        ModelCommand::AddArguments();
    }

    ~ReadBinaryInputBasicPresentValue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x000F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BinaryInputBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePresentValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<BooleanAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteBinaryInputBasicPresentValue : public ModelCommand
{
public:
    WriteBinaryInputBasicPresentValue() : ModelCommand("write")
    {
        AddArgument("attr-name", "present-value");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteBinaryInputBasicPresentValue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x000F) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::BinaryInputBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributePresentValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

class ReportBinaryInputBasicPresentValue : public ModelCommand
{
public:
    ReportBinaryInputBasicPresentValue() : ModelCommand("report")
    {
        AddArgument("attr-name", "present-value");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        ModelCommand::AddArguments();
    }

    ~ReportBinaryInputBasicPresentValue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x000F) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::BinaryInputBasicCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributePresentValue(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributePresentValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                      mMaxInterval);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<BooleanAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
};

/*
 * Attribute StatusFlags
 */
class ReadBinaryInputBasicStatusFlags : public ModelCommand
{
public:
    ReadBinaryInputBasicStatusFlags() : ModelCommand("read")
    {
        AddArgument("attr-name", "status-flags");
        ModelCommand::AddArguments();
    }

    ~ReadBinaryInputBasicStatusFlags()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x000F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BinaryInputBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeStatusFlags(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportBinaryInputBasicStatusFlags : public ModelCommand
{
public:
    ReportBinaryInputBasicStatusFlags() : ModelCommand("report")
    {
        AddArgument("attr-name", "status-flags");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        ModelCommand::AddArguments();
    }

    ~ReportBinaryInputBasicStatusFlags()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x000F) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::BinaryInputBasicCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeStatusFlags(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeStatusFlags(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                     mMaxInterval);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int8uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
};

/*
 * Attribute ClusterRevision
 */
class ReadBinaryInputBasicClusterRevision : public ModelCommand
{
public:
    ReadBinaryInputBasicClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadBinaryInputBasicClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x000F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BinaryInputBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster Binding                                                     | 0xF000 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * Bind                                                              |   0x00 |
| * Unbind                                                            |   0x01 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command Bind
 */
class BindingBind : public ModelCommand
{
public:
    BindingBind() : ModelCommand("bind")
    {
        AddArgument("NodeId", 0, UINT64_MAX, &mNodeId);
        AddArgument("GroupId", 0, UINT16_MAX, &mGroupId);
        AddArgument("EndpointId", 0, UINT16_MAX, &mEndpointId);
        AddArgument("ClusterId", 0, UINT32_MAX, &mClusterId);
        ModelCommand::AddArguments();
    }
    ~BindingBind()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0xF000) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BindingCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.Bind(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mNodeId, mGroupId, mEndpointId, mClusterId);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::NodeId mNodeId;
    chip::GroupId mGroupId;
    chip::EndpointId mEndpointId;
    chip::ClusterId mClusterId;
};

/*
 * Command Unbind
 */
class BindingUnbind : public ModelCommand
{
public:
    BindingUnbind() : ModelCommand("unbind")
    {
        AddArgument("NodeId", 0, UINT64_MAX, &mNodeId);
        AddArgument("GroupId", 0, UINT16_MAX, &mGroupId);
        AddArgument("EndpointId", 0, UINT16_MAX, &mEndpointId);
        AddArgument("ClusterId", 0, UINT32_MAX, &mClusterId);
        ModelCommand::AddArguments();
    }
    ~BindingUnbind()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0xF000) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::BindingCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.Unbind(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mNodeId, mGroupId, mEndpointId, mClusterId);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::NodeId mNodeId;
    chip::GroupId mGroupId;
    chip::EndpointId mEndpointId;
    chip::ClusterId mClusterId;
};

/*
 * Discover Attributes
 */
class DiscoverBindingAttributes : public ModelCommand
{
public:
    DiscoverBindingAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverBindingAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::BindingCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadBindingClusterRevision : public ModelCommand
{
public:
    ReadBindingClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadBindingClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0xF000) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BindingCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster BridgedDeviceBasic                                          | 0x0039 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * VendorName                                                        | 0x0001 |
| * VendorID                                                          | 0x0002 |
| * ProductName                                                       | 0x0003 |
| * UserLabel                                                         | 0x0005 |
| * HardwareVersion                                                   | 0x0007 |
| * HardwareVersionString                                             | 0x0008 |
| * SoftwareVersion                                                   | 0x0009 |
| * SoftwareVersionString                                             | 0x000A |
| * ManufacturingDate                                                 | 0x000B |
| * PartNumber                                                        | 0x000C |
| * ProductURL                                                        | 0x000D |
| * ProductLabel                                                      | 0x000E |
| * SerialNumber                                                      | 0x000F |
| * Reachable                                                         | 0x0011 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Discover Attributes
 */
class DiscoverBridgedDeviceBasicAttributes : public ModelCommand
{
public:
    DiscoverBridgedDeviceBasicAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverBridgedDeviceBasicAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::BridgedDeviceBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute VendorName
 */
class ReadBridgedDeviceBasicVendorName : public ModelCommand
{
public:
    ReadBridgedDeviceBasicVendorName() : ModelCommand("read")
    {
        AddArgument("attr-name", "vendor-name");
        ModelCommand::AddArguments();
    }

    ~ReadBridgedDeviceBasicVendorName()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BridgedDeviceBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeVendorName(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute VendorID
 */
class ReadBridgedDeviceBasicVendorID : public ModelCommand
{
public:
    ReadBridgedDeviceBasicVendorID() : ModelCommand("read")
    {
        AddArgument("attr-name", "vendor-id");
        ModelCommand::AddArguments();
    }

    ~ReadBridgedDeviceBasicVendorID()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BridgedDeviceBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeVendorID(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ProductName
 */
class ReadBridgedDeviceBasicProductName : public ModelCommand
{
public:
    ReadBridgedDeviceBasicProductName() : ModelCommand("read")
    {
        AddArgument("attr-name", "product-name");
        ModelCommand::AddArguments();
    }

    ~ReadBridgedDeviceBasicProductName()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BridgedDeviceBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeProductName(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute UserLabel
 */
class ReadBridgedDeviceBasicUserLabel : public ModelCommand
{
public:
    ReadBridgedDeviceBasicUserLabel() : ModelCommand("read")
    {
        AddArgument("attr-name", "user-label");
        ModelCommand::AddArguments();
    }

    ~ReadBridgedDeviceBasicUserLabel()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BridgedDeviceBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeUserLabel(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteBridgedDeviceBasicUserLabel : public ModelCommand
{
public:
    WriteBridgedDeviceBasicUserLabel() : ModelCommand("write")
    {
        AddArgument("attr-name", "user-label");
        AddArgument("attr-value", &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteBridgedDeviceBasicUserLabel()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::BridgedDeviceBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeUserLabel(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                               chip::ByteSpan(chip::Uint8::from_char(mValue), strlen(mValue)));
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mValue;
};

/*
 * Attribute HardwareVersion
 */
class ReadBridgedDeviceBasicHardwareVersion : public ModelCommand
{
public:
    ReadBridgedDeviceBasicHardwareVersion() : ModelCommand("read")
    {
        AddArgument("attr-name", "hardware-version");
        ModelCommand::AddArguments();
    }

    ~ReadBridgedDeviceBasicHardwareVersion()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BridgedDeviceBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeHardwareVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute HardwareVersionString
 */
class ReadBridgedDeviceBasicHardwareVersionString : public ModelCommand
{
public:
    ReadBridgedDeviceBasicHardwareVersionString() : ModelCommand("read")
    {
        AddArgument("attr-name", "hardware-version-string");
        ModelCommand::AddArguments();
    }

    ~ReadBridgedDeviceBasicHardwareVersionString()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BridgedDeviceBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeHardwareVersionString(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute SoftwareVersion
 */
class ReadBridgedDeviceBasicSoftwareVersion : public ModelCommand
{
public:
    ReadBridgedDeviceBasicSoftwareVersion() : ModelCommand("read")
    {
        AddArgument("attr-name", "software-version");
        ModelCommand::AddArguments();
    }

    ~ReadBridgedDeviceBasicSoftwareVersion()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BridgedDeviceBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeSoftwareVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute SoftwareVersionString
 */
class ReadBridgedDeviceBasicSoftwareVersionString : public ModelCommand
{
public:
    ReadBridgedDeviceBasicSoftwareVersionString() : ModelCommand("read")
    {
        AddArgument("attr-name", "software-version-string");
        ModelCommand::AddArguments();
    }

    ~ReadBridgedDeviceBasicSoftwareVersionString()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BridgedDeviceBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeSoftwareVersionString(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ManufacturingDate
 */
class ReadBridgedDeviceBasicManufacturingDate : public ModelCommand
{
public:
    ReadBridgedDeviceBasicManufacturingDate() : ModelCommand("read")
    {
        AddArgument("attr-name", "manufacturing-date");
        ModelCommand::AddArguments();
    }

    ~ReadBridgedDeviceBasicManufacturingDate()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BridgedDeviceBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeManufacturingDate(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute PartNumber
 */
class ReadBridgedDeviceBasicPartNumber : public ModelCommand
{
public:
    ReadBridgedDeviceBasicPartNumber() : ModelCommand("read")
    {
        AddArgument("attr-name", "part-number");
        ModelCommand::AddArguments();
    }

    ~ReadBridgedDeviceBasicPartNumber()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BridgedDeviceBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePartNumber(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ProductURL
 */
class ReadBridgedDeviceBasicProductURL : public ModelCommand
{
public:
    ReadBridgedDeviceBasicProductURL() : ModelCommand("read")
    {
        AddArgument("attr-name", "product-url");
        ModelCommand::AddArguments();
    }

    ~ReadBridgedDeviceBasicProductURL()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BridgedDeviceBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeProductURL(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ProductLabel
 */
class ReadBridgedDeviceBasicProductLabel : public ModelCommand
{
public:
    ReadBridgedDeviceBasicProductLabel() : ModelCommand("read")
    {
        AddArgument("attr-name", "product-label");
        ModelCommand::AddArguments();
    }

    ~ReadBridgedDeviceBasicProductLabel()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BridgedDeviceBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeProductLabel(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute SerialNumber
 */
class ReadBridgedDeviceBasicSerialNumber : public ModelCommand
{
public:
    ReadBridgedDeviceBasicSerialNumber() : ModelCommand("read")
    {
        AddArgument("attr-name", "serial-number");
        ModelCommand::AddArguments();
    }

    ~ReadBridgedDeviceBasicSerialNumber()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BridgedDeviceBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeSerialNumber(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Reachable
 */
class ReadBridgedDeviceBasicReachable : public ModelCommand
{
public:
    ReadBridgedDeviceBasicReachable() : ModelCommand("read")
    {
        AddArgument("attr-name", "reachable");
        ModelCommand::AddArguments();
    }

    ~ReadBridgedDeviceBasicReachable()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BridgedDeviceBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeReachable(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<BooleanAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadBridgedDeviceBasicClusterRevision : public ModelCommand
{
public:
    ReadBridgedDeviceBasicClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadBridgedDeviceBasicClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0039) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::BridgedDeviceBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster ColorControl                                                | 0x0300 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * ColorLoopSet                                                      |   0x44 |
| * EnhancedMoveHue                                                   |   0x41 |
| * EnhancedMoveToHue                                                 |   0x40 |
| * EnhancedMoveToHueAndSaturation                                    |   0x43 |
| * EnhancedStepHue                                                   |   0x42 |
| * MoveColor                                                         |   0x08 |
| * MoveColorTemperature                                              |   0x4B |
| * MoveHue                                                           |   0x01 |
| * MoveSaturation                                                    |   0x04 |
| * MoveToColor                                                       |   0x07 |
| * MoveToColorTemperature                                            |   0x0A |
| * MoveToHue                                                         |   0x00 |
| * MoveToHueAndSaturation                                            |   0x06 |
| * MoveToSaturation                                                  |   0x03 |
| * StepColor                                                         |   0x09 |
| * StepColorTemperature                                              |   0x4C |
| * StepHue                                                           |   0x02 |
| * StepSaturation                                                    |   0x05 |
| * StopMoveStep                                                      |   0x47 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * CurrentHue                                                        | 0x0000 |
| * CurrentSaturation                                                 | 0x0001 |
| * RemainingTime                                                     | 0x0002 |
| * CurrentX                                                          | 0x0003 |
| * CurrentY                                                          | 0x0004 |
| * DriftCompensation                                                 | 0x0005 |
| * CompensationText                                                  | 0x0006 |
| * ColorTemperature                                                  | 0x0007 |
| * ColorMode                                                         | 0x0008 |
| * ColorControlOptions                                               | 0x000F |
| * NumberOfPrimaries                                                 | 0x0010 |
| * Primary1X                                                         | 0x0011 |
| * Primary1Y                                                         | 0x0012 |
| * Primary1Intensity                                                 | 0x0013 |
| * Primary2X                                                         | 0x0015 |
| * Primary2Y                                                         | 0x0016 |
| * Primary2Intensity                                                 | 0x0017 |
| * Primary3X                                                         | 0x0019 |
| * Primary3Y                                                         | 0x001A |
| * Primary3Intensity                                                 | 0x001B |
| * Primary4X                                                         | 0x0020 |
| * Primary4Y                                                         | 0x0021 |
| * Primary4Intensity                                                 | 0x0022 |
| * Primary5X                                                         | 0x0024 |
| * Primary5Y                                                         | 0x0025 |
| * Primary5Intensity                                                 | 0x0026 |
| * Primary6X                                                         | 0x0028 |
| * Primary6Y                                                         | 0x0029 |
| * Primary6Intensity                                                 | 0x002A |
| * WhitePointX                                                       | 0x0030 |
| * WhitePointY                                                       | 0x0031 |
| * ColorPointRX                                                      | 0x0032 |
| * ColorPointRY                                                      | 0x0033 |
| * ColorPointRIntensity                                              | 0x0034 |
| * ColorPointGX                                                      | 0x0036 |
| * ColorPointGY                                                      | 0x0037 |
| * ColorPointGIntensity                                              | 0x0038 |
| * ColorPointBX                                                      | 0x003A |
| * ColorPointBY                                                      | 0x003B |
| * ColorPointBIntensity                                              | 0x003C |
| * EnhancedCurrentHue                                                | 0x4000 |
| * EnhancedColorMode                                                 | 0x4001 |
| * ColorLoopActive                                                   | 0x4002 |
| * ColorLoopDirection                                                | 0x4003 |
| * ColorLoopTime                                                     | 0x4004 |
| * ColorCapabilities                                                 | 0x400A |
| * ColorTempPhysicalMin                                              | 0x400B |
| * ColorTempPhysicalMax                                              | 0x400C |
| * CoupleColorTempToLevelMinMireds                                   | 0x400D |
| * StartUpColorTemperatureMireds                                     | 0x4010 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command ColorLoopSet
 */
class ColorControlColorLoopSet : public ModelCommand
{
public:
    ColorControlColorLoopSet() : ModelCommand("color-loop-set")
    {
        AddArgument("UpdateFlags", 0, UINT8_MAX, &mUpdateFlags);
        AddArgument("Action", 0, UINT8_MAX, &mAction);
        AddArgument("Direction", 0, UINT8_MAX, &mDirection);
        AddArgument("Time", 0, UINT16_MAX, &mTime);
        AddArgument("StartHue", 0, UINT16_MAX, &mStartHue);
        AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlColorLoopSet()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x44) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ColorLoopSet(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUpdateFlags, mAction, mDirection,
                                    mTime, mStartHue, mOptionsMask, mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mUpdateFlags;
    uint8_t mAction;
    uint8_t mDirection;
    uint16_t mTime;
    uint16_t mStartHue;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command EnhancedMoveHue
 */
class ColorControlEnhancedMoveHue : public ModelCommand
{
public:
    ColorControlEnhancedMoveHue() : ModelCommand("enhanced-move-hue")
    {
        AddArgument("MoveMode", 0, UINT8_MAX, &mMoveMode);
        AddArgument("Rate", 0, UINT16_MAX, &mRate);
        AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlEnhancedMoveHue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x41) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.EnhancedMoveHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMoveMode, mRate, mOptionsMask,
                                       mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mMoveMode;
    uint16_t mRate;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command EnhancedMoveToHue
 */
class ColorControlEnhancedMoveToHue : public ModelCommand
{
public:
    ColorControlEnhancedMoveToHue() : ModelCommand("enhanced-move-to-hue")
    {
        AddArgument("EnhancedHue", 0, UINT16_MAX, &mEnhancedHue);
        AddArgument("Direction", 0, UINT8_MAX, &mDirection);
        AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime);
        AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlEnhancedMoveToHue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x40) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.EnhancedMoveToHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mEnhancedHue, mDirection,
                                         mTransitionTime, mOptionsMask, mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mEnhancedHue;
    uint8_t mDirection;
    uint16_t mTransitionTime;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command EnhancedMoveToHueAndSaturation
 */
class ColorControlEnhancedMoveToHueAndSaturation : public ModelCommand
{
public:
    ColorControlEnhancedMoveToHueAndSaturation() : ModelCommand("enhanced-move-to-hue-and-saturation")
    {
        AddArgument("EnhancedHue", 0, UINT16_MAX, &mEnhancedHue);
        AddArgument("Saturation", 0, UINT8_MAX, &mSaturation);
        AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime);
        AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlEnhancedMoveToHueAndSaturation()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x43) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.EnhancedMoveToHueAndSaturation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mEnhancedHue,
                                                      mSaturation, mTransitionTime, mOptionsMask, mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mEnhancedHue;
    uint8_t mSaturation;
    uint16_t mTransitionTime;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command EnhancedStepHue
 */
class ColorControlEnhancedStepHue : public ModelCommand
{
public:
    ColorControlEnhancedStepHue() : ModelCommand("enhanced-step-hue")
    {
        AddArgument("StepMode", 0, UINT8_MAX, &mStepMode);
        AddArgument("StepSize", 0, UINT16_MAX, &mStepSize);
        AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime);
        AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlEnhancedStepHue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x42) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.EnhancedStepHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStepMode, mStepSize,
                                       mTransitionTime, mOptionsMask, mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mStepMode;
    uint16_t mStepSize;
    uint16_t mTransitionTime;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command MoveColor
 */
class ColorControlMoveColor : public ModelCommand
{
public:
    ColorControlMoveColor() : ModelCommand("move-color")
    {
        AddArgument("RateX", INT16_MIN, INT16_MAX, &mRateX);
        AddArgument("RateY", INT16_MIN, INT16_MAX, &mRateY);
        AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlMoveColor()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x08) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MoveColor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mRateX, mRateY, mOptionsMask,
                                 mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    int16_t mRateX;
    int16_t mRateY;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command MoveColorTemperature
 */
class ColorControlMoveColorTemperature : public ModelCommand
{
public:
    ColorControlMoveColorTemperature() : ModelCommand("move-color-temperature")
    {
        AddArgument("MoveMode", 0, UINT8_MAX, &mMoveMode);
        AddArgument("Rate", 0, UINT16_MAX, &mRate);
        AddArgument("ColorTemperatureMinimum", 0, UINT16_MAX, &mColorTemperatureMinimum);
        AddArgument("ColorTemperatureMaximum", 0, UINT16_MAX, &mColorTemperatureMaximum);
        AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlMoveColorTemperature()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x4B) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MoveColorTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMoveMode, mRate,
                                            mColorTemperatureMinimum, mColorTemperatureMaximum, mOptionsMask, mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mMoveMode;
    uint16_t mRate;
    uint16_t mColorTemperatureMinimum;
    uint16_t mColorTemperatureMaximum;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command MoveHue
 */
class ColorControlMoveHue : public ModelCommand
{
public:
    ColorControlMoveHue() : ModelCommand("move-hue")
    {
        AddArgument("MoveMode", 0, UINT8_MAX, &mMoveMode);
        AddArgument("Rate", 0, UINT8_MAX, &mRate);
        AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlMoveHue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MoveHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMoveMode, mRate, mOptionsMask,
                               mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mMoveMode;
    uint8_t mRate;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command MoveSaturation
 */
class ColorControlMoveSaturation : public ModelCommand
{
public:
    ColorControlMoveSaturation() : ModelCommand("move-saturation")
    {
        AddArgument("MoveMode", 0, UINT8_MAX, &mMoveMode);
        AddArgument("Rate", 0, UINT8_MAX, &mRate);
        AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlMoveSaturation()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x04) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MoveSaturation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMoveMode, mRate, mOptionsMask,
                                      mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mMoveMode;
    uint8_t mRate;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command MoveToColor
 */
class ColorControlMoveToColor : public ModelCommand
{
public:
    ColorControlMoveToColor() : ModelCommand("move-to-color")
    {
        AddArgument("ColorX", 0, UINT16_MAX, &mColorX);
        AddArgument("ColorY", 0, UINT16_MAX, &mColorY);
        AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime);
        AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlMoveToColor()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x07) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MoveToColor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mColorX, mColorY, mTransitionTime,
                                   mOptionsMask, mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mColorX;
    uint16_t mColorY;
    uint16_t mTransitionTime;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command MoveToColorTemperature
 */
class ColorControlMoveToColorTemperature : public ModelCommand
{
public:
    ColorControlMoveToColorTemperature() : ModelCommand("move-to-color-temperature")
    {
        AddArgument("ColorTemperature", 0, UINT16_MAX, &mColorTemperature);
        AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime);
        AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlMoveToColorTemperature()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x0A) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MoveToColorTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mColorTemperature,
                                              mTransitionTime, mOptionsMask, mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mColorTemperature;
    uint16_t mTransitionTime;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command MoveToHue
 */
class ColorControlMoveToHue : public ModelCommand
{
public:
    ColorControlMoveToHue() : ModelCommand("move-to-hue")
    {
        AddArgument("Hue", 0, UINT8_MAX, &mHue);
        AddArgument("Direction", 0, UINT8_MAX, &mDirection);
        AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime);
        AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlMoveToHue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MoveToHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mHue, mDirection, mTransitionTime,
                                 mOptionsMask, mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mHue;
    uint8_t mDirection;
    uint16_t mTransitionTime;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command MoveToHueAndSaturation
 */
class ColorControlMoveToHueAndSaturation : public ModelCommand
{
public:
    ColorControlMoveToHueAndSaturation() : ModelCommand("move-to-hue-and-saturation")
    {
        AddArgument("Hue", 0, UINT8_MAX, &mHue);
        AddArgument("Saturation", 0, UINT8_MAX, &mSaturation);
        AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime);
        AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlMoveToHueAndSaturation()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MoveToHueAndSaturation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mHue, mSaturation,
                                              mTransitionTime, mOptionsMask, mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mHue;
    uint8_t mSaturation;
    uint16_t mTransitionTime;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command MoveToSaturation
 */
class ColorControlMoveToSaturation : public ModelCommand
{
public:
    ColorControlMoveToSaturation() : ModelCommand("move-to-saturation")
    {
        AddArgument("Saturation", 0, UINT8_MAX, &mSaturation);
        AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime);
        AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlMoveToSaturation()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x03) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MoveToSaturation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mSaturation, mTransitionTime,
                                        mOptionsMask, mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mSaturation;
    uint16_t mTransitionTime;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command StepColor
 */
class ColorControlStepColor : public ModelCommand
{
public:
    ColorControlStepColor() : ModelCommand("step-color")
    {
        AddArgument("StepX", INT16_MIN, INT16_MAX, &mStepX);
        AddArgument("StepY", INT16_MIN, INT16_MAX, &mStepY);
        AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime);
        AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlStepColor()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x09) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.StepColor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStepX, mStepY, mTransitionTime,
                                 mOptionsMask, mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    int16_t mStepX;
    int16_t mStepY;
    uint16_t mTransitionTime;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command StepColorTemperature
 */
class ColorControlStepColorTemperature : public ModelCommand
{
public:
    ColorControlStepColorTemperature() : ModelCommand("step-color-temperature")
    {
        AddArgument("StepMode", 0, UINT8_MAX, &mStepMode);
        AddArgument("StepSize", 0, UINT16_MAX, &mStepSize);
        AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime);
        AddArgument("ColorTemperatureMinimum", 0, UINT16_MAX, &mColorTemperatureMinimum);
        AddArgument("ColorTemperatureMaximum", 0, UINT16_MAX, &mColorTemperatureMaximum);
        AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlStepColorTemperature()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x4C) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.StepColorTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStepMode, mStepSize,
                                            mTransitionTime, mColorTemperatureMinimum, mColorTemperatureMaximum, mOptionsMask,
                                            mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mStepMode;
    uint16_t mStepSize;
    uint16_t mTransitionTime;
    uint16_t mColorTemperatureMinimum;
    uint16_t mColorTemperatureMaximum;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command StepHue
 */
class ColorControlStepHue : public ModelCommand
{
public:
    ColorControlStepHue() : ModelCommand("step-hue")
    {
        AddArgument("StepMode", 0, UINT8_MAX, &mStepMode);
        AddArgument("StepSize", 0, UINT8_MAX, &mStepSize);
        AddArgument("TransitionTime", 0, UINT8_MAX, &mTransitionTime);
        AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlStepHue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x02) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.StepHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStepMode, mStepSize, mTransitionTime,
                               mOptionsMask, mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mStepMode;
    uint8_t mStepSize;
    uint8_t mTransitionTime;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command StepSaturation
 */
class ColorControlStepSaturation : public ModelCommand
{
public:
    ColorControlStepSaturation() : ModelCommand("step-saturation")
    {
        AddArgument("StepMode", 0, UINT8_MAX, &mStepMode);
        AddArgument("StepSize", 0, UINT8_MAX, &mStepSize);
        AddArgument("TransitionTime", 0, UINT8_MAX, &mTransitionTime);
        AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlStepSaturation()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x05) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.StepSaturation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStepMode, mStepSize,
                                      mTransitionTime, mOptionsMask, mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mStepMode;
    uint8_t mStepSize;
    uint8_t mTransitionTime;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command StopMoveStep
 */
class ColorControlStopMoveStep : public ModelCommand
{
public:
    ColorControlStopMoveStep() : ModelCommand("stop-move-step")
    {
        AddArgument("OptionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("OptionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlStopMoveStep()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x47) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.StopMoveStep(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mOptionsMask, mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Discover Attributes
 */
class DiscoverColorControlAttributes : public ModelCommand
{
public:
    DiscoverColorControlAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverColorControlAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CurrentHue
 */
class ReadColorControlCurrentHue : public ModelCommand
{
public:
    ReadColorControlCurrentHue() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-hue");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlCurrentHue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportColorControlCurrentHue : public ModelCommand
{
public:
    ReportColorControlCurrentHue() : ModelCommand("report")
    {
        AddArgument("attr-name", "current-hue");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", 0, UINT8_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportColorControlCurrentHue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeCurrentHue(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeCurrentHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                    mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int8uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    uint8_t mChange;
};

/*
 * Attribute CurrentSaturation
 */
class ReadColorControlCurrentSaturation : public ModelCommand
{
public:
    ReadColorControlCurrentSaturation() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-saturation");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlCurrentSaturation()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentSaturation(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportColorControlCurrentSaturation : public ModelCommand
{
public:
    ReportColorControlCurrentSaturation() : ModelCommand("report")
    {
        AddArgument("attr-name", "current-saturation");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", 0, UINT8_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportColorControlCurrentSaturation()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeCurrentSaturation(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeCurrentSaturation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                           mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int8uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    uint8_t mChange;
};

/*
 * Attribute RemainingTime
 */
class ReadColorControlRemainingTime : public ModelCommand
{
public:
    ReadColorControlRemainingTime() : ModelCommand("read")
    {
        AddArgument("attr-name", "remaining-time");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlRemainingTime()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRemainingTime(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CurrentX
 */
class ReadColorControlCurrentX : public ModelCommand
{
public:
    ReadColorControlCurrentX() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-x");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlCurrentX()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentX(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportColorControlCurrentX : public ModelCommand
{
public:
    ReportColorControlCurrentX() : ModelCommand("report")
    {
        AddArgument("attr-name", "current-x");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", 0, UINT16_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportColorControlCurrentX()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeCurrentX(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeCurrentX(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                  mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int16uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    uint16_t mChange;
};

/*
 * Attribute CurrentY
 */
class ReadColorControlCurrentY : public ModelCommand
{
public:
    ReadColorControlCurrentY() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-y");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlCurrentY()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentY(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportColorControlCurrentY : public ModelCommand
{
public:
    ReportColorControlCurrentY() : ModelCommand("report")
    {
        AddArgument("attr-name", "current-y");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", 0, UINT16_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportColorControlCurrentY()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeCurrentY(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeCurrentY(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                  mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int16uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    uint16_t mChange;
};

/*
 * Attribute DriftCompensation
 */
class ReadColorControlDriftCompensation : public ModelCommand
{
public:
    ReadColorControlDriftCompensation() : ModelCommand("read")
    {
        AddArgument("attr-name", "drift-compensation");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlDriftCompensation()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeDriftCompensation(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CompensationText
 */
class ReadColorControlCompensationText : public ModelCommand
{
public:
    ReadColorControlCompensationText() : ModelCommand("read")
    {
        AddArgument("attr-name", "compensation-text");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlCompensationText()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCompensationText(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ColorTemperature
 */
class ReadColorControlColorTemperature : public ModelCommand
{
public:
    ReadColorControlColorTemperature() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-temperature");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorTemperature()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportColorControlColorTemperature : public ModelCommand
{
public:
    ReportColorControlColorTemperature() : ModelCommand("report")
    {
        AddArgument("attr-name", "color-temperature");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", 0, UINT16_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportColorControlColorTemperature()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeColorTemperature(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeColorTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                          mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int16uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    uint16_t mChange;
};

/*
 * Attribute ColorMode
 */
class ReadColorControlColorMode : public ModelCommand
{
public:
    ReadColorControlColorMode() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-mode");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorMode()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ColorControlOptions
 */
class ReadColorControlColorControlOptions : public ModelCommand
{
public:
    ReadColorControlColorControlOptions() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-control-options");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorControlOptions()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorControlOptions(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlColorControlOptions : public ModelCommand
{
public:
    WriteColorControlColorControlOptions() : ModelCommand("write")
    {
        AddArgument("attr-name", "color-control-options");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlColorControlOptions()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeColorControlOptions(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute NumberOfPrimaries
 */
class ReadColorControlNumberOfPrimaries : public ModelCommand
{
public:
    ReadColorControlNumberOfPrimaries() : ModelCommand("read")
    {
        AddArgument("attr-name", "number-of-primaries");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlNumberOfPrimaries()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeNumberOfPrimaries(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary1X
 */
class ReadColorControlPrimary1X : public ModelCommand
{
public:
    ReadColorControlPrimary1X() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary1x");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary1X()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary1X(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary1Y
 */
class ReadColorControlPrimary1Y : public ModelCommand
{
public:
    ReadColorControlPrimary1Y() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary1y");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary1Y()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary1Y(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary1Intensity
 */
class ReadColorControlPrimary1Intensity : public ModelCommand
{
public:
    ReadColorControlPrimary1Intensity() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary1intensity");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary1Intensity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary1Intensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary2X
 */
class ReadColorControlPrimary2X : public ModelCommand
{
public:
    ReadColorControlPrimary2X() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary2x");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary2X()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary2X(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary2Y
 */
class ReadColorControlPrimary2Y : public ModelCommand
{
public:
    ReadColorControlPrimary2Y() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary2y");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary2Y()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary2Y(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary2Intensity
 */
class ReadColorControlPrimary2Intensity : public ModelCommand
{
public:
    ReadColorControlPrimary2Intensity() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary2intensity");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary2Intensity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary2Intensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary3X
 */
class ReadColorControlPrimary3X : public ModelCommand
{
public:
    ReadColorControlPrimary3X() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary3x");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary3X()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary3X(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary3Y
 */
class ReadColorControlPrimary3Y : public ModelCommand
{
public:
    ReadColorControlPrimary3Y() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary3y");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary3Y()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary3Y(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary3Intensity
 */
class ReadColorControlPrimary3Intensity : public ModelCommand
{
public:
    ReadColorControlPrimary3Intensity() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary3intensity");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary3Intensity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary3Intensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary4X
 */
class ReadColorControlPrimary4X : public ModelCommand
{
public:
    ReadColorControlPrimary4X() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary4x");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary4X()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary4X(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary4Y
 */
class ReadColorControlPrimary4Y : public ModelCommand
{
public:
    ReadColorControlPrimary4Y() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary4y");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary4Y()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary4Y(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary4Intensity
 */
class ReadColorControlPrimary4Intensity : public ModelCommand
{
public:
    ReadColorControlPrimary4Intensity() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary4intensity");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary4Intensity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary4Intensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary5X
 */
class ReadColorControlPrimary5X : public ModelCommand
{
public:
    ReadColorControlPrimary5X() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary5x");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary5X()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary5X(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary5Y
 */
class ReadColorControlPrimary5Y : public ModelCommand
{
public:
    ReadColorControlPrimary5Y() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary5y");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary5Y()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary5Y(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary5Intensity
 */
class ReadColorControlPrimary5Intensity : public ModelCommand
{
public:
    ReadColorControlPrimary5Intensity() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary5intensity");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary5Intensity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary5Intensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary6X
 */
class ReadColorControlPrimary6X : public ModelCommand
{
public:
    ReadColorControlPrimary6X() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary6x");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary6X()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary6X(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary6Y
 */
class ReadColorControlPrimary6Y : public ModelCommand
{
public:
    ReadColorControlPrimary6Y() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary6y");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary6Y()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary6Y(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary6Intensity
 */
class ReadColorControlPrimary6Intensity : public ModelCommand
{
public:
    ReadColorControlPrimary6Intensity() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary6intensity");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary6Intensity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary6Intensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute WhitePointX
 */
class ReadColorControlWhitePointX : public ModelCommand
{
public:
    ReadColorControlWhitePointX() : ModelCommand("read")
    {
        AddArgument("attr-name", "white-point-x");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlWhitePointX()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeWhitePointX(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlWhitePointX : public ModelCommand
{
public:
    WriteColorControlWhitePointX() : ModelCommand("write")
    {
        AddArgument("attr-name", "white-point-x");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlWhitePointX()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeWhitePointX(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute WhitePointY
 */
class ReadColorControlWhitePointY : public ModelCommand
{
public:
    ReadColorControlWhitePointY() : ModelCommand("read")
    {
        AddArgument("attr-name", "white-point-y");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlWhitePointY()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeWhitePointY(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlWhitePointY : public ModelCommand
{
public:
    WriteColorControlWhitePointY() : ModelCommand("write")
    {
        AddArgument("attr-name", "white-point-y");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlWhitePointY()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeWhitePointY(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute ColorPointRX
 */
class ReadColorControlColorPointRX : public ModelCommand
{
public:
    ReadColorControlColorPointRX() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-point-rx");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorPointRX()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorPointRX(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlColorPointRX : public ModelCommand
{
public:
    WriteColorControlColorPointRX() : ModelCommand("write")
    {
        AddArgument("attr-name", "color-point-rx");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlColorPointRX()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeColorPointRX(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute ColorPointRY
 */
class ReadColorControlColorPointRY : public ModelCommand
{
public:
    ReadColorControlColorPointRY() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-point-ry");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorPointRY()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorPointRY(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlColorPointRY : public ModelCommand
{
public:
    WriteColorControlColorPointRY() : ModelCommand("write")
    {
        AddArgument("attr-name", "color-point-ry");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlColorPointRY()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeColorPointRY(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute ColorPointRIntensity
 */
class ReadColorControlColorPointRIntensity : public ModelCommand
{
public:
    ReadColorControlColorPointRIntensity() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-point-rintensity");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorPointRIntensity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorPointRIntensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlColorPointRIntensity : public ModelCommand
{
public:
    WriteColorControlColorPointRIntensity() : ModelCommand("write")
    {
        AddArgument("attr-name", "color-point-rintensity");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlColorPointRIntensity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeColorPointRIntensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute ColorPointGX
 */
class ReadColorControlColorPointGX : public ModelCommand
{
public:
    ReadColorControlColorPointGX() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-point-gx");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorPointGX()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorPointGX(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlColorPointGX : public ModelCommand
{
public:
    WriteColorControlColorPointGX() : ModelCommand("write")
    {
        AddArgument("attr-name", "color-point-gx");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlColorPointGX()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeColorPointGX(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute ColorPointGY
 */
class ReadColorControlColorPointGY : public ModelCommand
{
public:
    ReadColorControlColorPointGY() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-point-gy");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorPointGY()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorPointGY(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlColorPointGY : public ModelCommand
{
public:
    WriteColorControlColorPointGY() : ModelCommand("write")
    {
        AddArgument("attr-name", "color-point-gy");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlColorPointGY()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeColorPointGY(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute ColorPointGIntensity
 */
class ReadColorControlColorPointGIntensity : public ModelCommand
{
public:
    ReadColorControlColorPointGIntensity() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-point-gintensity");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorPointGIntensity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorPointGIntensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlColorPointGIntensity : public ModelCommand
{
public:
    WriteColorControlColorPointGIntensity() : ModelCommand("write")
    {
        AddArgument("attr-name", "color-point-gintensity");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlColorPointGIntensity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeColorPointGIntensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute ColorPointBX
 */
class ReadColorControlColorPointBX : public ModelCommand
{
public:
    ReadColorControlColorPointBX() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-point-bx");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorPointBX()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorPointBX(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlColorPointBX : public ModelCommand
{
public:
    WriteColorControlColorPointBX() : ModelCommand("write")
    {
        AddArgument("attr-name", "color-point-bx");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlColorPointBX()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeColorPointBX(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute ColorPointBY
 */
class ReadColorControlColorPointBY : public ModelCommand
{
public:
    ReadColorControlColorPointBY() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-point-by");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorPointBY()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorPointBY(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlColorPointBY : public ModelCommand
{
public:
    WriteColorControlColorPointBY() : ModelCommand("write")
    {
        AddArgument("attr-name", "color-point-by");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlColorPointBY()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeColorPointBY(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute ColorPointBIntensity
 */
class ReadColorControlColorPointBIntensity : public ModelCommand
{
public:
    ReadColorControlColorPointBIntensity() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-point-bintensity");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorPointBIntensity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorPointBIntensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlColorPointBIntensity : public ModelCommand
{
public:
    WriteColorControlColorPointBIntensity() : ModelCommand("write")
    {
        AddArgument("attr-name", "color-point-bintensity");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlColorPointBIntensity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeColorPointBIntensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute EnhancedCurrentHue
 */
class ReadColorControlEnhancedCurrentHue : public ModelCommand
{
public:
    ReadColorControlEnhancedCurrentHue() : ModelCommand("read")
    {
        AddArgument("attr-name", "enhanced-current-hue");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlEnhancedCurrentHue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeEnhancedCurrentHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute EnhancedColorMode
 */
class ReadColorControlEnhancedColorMode : public ModelCommand
{
public:
    ReadColorControlEnhancedColorMode() : ModelCommand("read")
    {
        AddArgument("attr-name", "enhanced-color-mode");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlEnhancedColorMode()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeEnhancedColorMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ColorLoopActive
 */
class ReadColorControlColorLoopActive : public ModelCommand
{
public:
    ReadColorControlColorLoopActive() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-loop-active");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorLoopActive()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorLoopActive(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ColorLoopDirection
 */
class ReadColorControlColorLoopDirection : public ModelCommand
{
public:
    ReadColorControlColorLoopDirection() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-loop-direction");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorLoopDirection()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorLoopDirection(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ColorLoopTime
 */
class ReadColorControlColorLoopTime : public ModelCommand
{
public:
    ReadColorControlColorLoopTime() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-loop-time");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorLoopTime()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorLoopTime(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ColorCapabilities
 */
class ReadColorControlColorCapabilities : public ModelCommand
{
public:
    ReadColorControlColorCapabilities() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-capabilities");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorCapabilities()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorCapabilities(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ColorTempPhysicalMin
 */
class ReadColorControlColorTempPhysicalMin : public ModelCommand
{
public:
    ReadColorControlColorTempPhysicalMin() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-temp-physical-min");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorTempPhysicalMin()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorTempPhysicalMin(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ColorTempPhysicalMax
 */
class ReadColorControlColorTempPhysicalMax : public ModelCommand
{
public:
    ReadColorControlColorTempPhysicalMax() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-temp-physical-max");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorTempPhysicalMax()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorTempPhysicalMax(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CoupleColorTempToLevelMinMireds
 */
class ReadColorControlCoupleColorTempToLevelMinMireds : public ModelCommand
{
public:
    ReadColorControlCoupleColorTempToLevelMinMireds() : ModelCommand("read")
    {
        AddArgument("attr-name", "couple-color-temp-to-level-min-mireds");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlCoupleColorTempToLevelMinMireds()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCoupleColorTempToLevelMinMireds(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute StartUpColorTemperatureMireds
 */
class ReadColorControlStartUpColorTemperatureMireds : public ModelCommand
{
public:
    ReadColorControlStartUpColorTemperatureMireds() : ModelCommand("read")
    {
        AddArgument("attr-name", "start-up-color-temperature-mireds");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlStartUpColorTemperatureMireds()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeStartUpColorTemperatureMireds(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlStartUpColorTemperatureMireds : public ModelCommand
{
public:
    WriteColorControlStartUpColorTemperatureMireds() : ModelCommand("write")
    {
        AddArgument("attr-name", "start-up-color-temperature-mireds");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlStartUpColorTemperatureMireds()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeStartUpColorTemperatureMireds(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                                                   mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute ClusterRevision
 */
class ReadColorControlClusterRevision : public ModelCommand
{
public:
    ReadColorControlClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster ContentLauncher                                             | 0x050A |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * LaunchContent                                                     |   0x00 |
| * LaunchURL                                                         |   0x01 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * AcceptsHeaderList                                                 | 0x0000 |
| * SupportedStreamingTypes                                           | 0x0001 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command LaunchContent
 */
class ContentLauncherLaunchContent : public ModelCommand
{
public:
    ContentLauncherLaunchContent() : ModelCommand("launch-content")
    {
        AddArgument("AutoPlay", 0, UINT8_MAX, &mAutoPlay);
        AddArgument("Data", &mData);
        ModelCommand::AddArguments();
    }
    ~ContentLauncherLaunchContent()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050A) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ContentLauncherCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.LaunchContent(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mAutoPlay,
                                     chip::ByteSpan(chip::Uint8::from_char(mData), strlen(mData)));
    }

private:
    chip::Callback::Callback<ContentLauncherClusterLaunchContentResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<ContentLauncherClusterLaunchContentResponseCallback>(
            OnContentLauncherClusterLaunchContentResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mAutoPlay;
    char * mData;
};

/*
 * Command LaunchURL
 */
class ContentLauncherLaunchURL : public ModelCommand
{
public:
    ContentLauncherLaunchURL() : ModelCommand("launch-url")
    {
        AddArgument("ContentURL", &mContentURL);
        AddArgument("DisplayString", &mDisplayString);
        ModelCommand::AddArguments();
    }
    ~ContentLauncherLaunchURL()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050A) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::ContentLauncherCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.LaunchURL(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                 chip::ByteSpan(chip::Uint8::from_char(mContentURL), strlen(mContentURL)),
                                 chip::ByteSpan(chip::Uint8::from_char(mDisplayString), strlen(mDisplayString)));
    }

private:
    chip::Callback::Callback<ContentLauncherClusterLaunchURLResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<ContentLauncherClusterLaunchURLResponseCallback>(OnContentLauncherClusterLaunchURLResponse,
                                                                                      this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mContentURL;
    char * mDisplayString;
};

/*
 * Discover Attributes
 */
class DiscoverContentLauncherAttributes : public ModelCommand
{
public:
    DiscoverContentLauncherAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverContentLauncherAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::ContentLauncherCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute AcceptsHeaderList
 */
class ReadContentLauncherAcceptsHeaderList : public ModelCommand
{
public:
    ReadContentLauncherAcceptsHeaderList() : ModelCommand("read")
    {
        AddArgument("attr-name", "accepts-header-list");
        ModelCommand::AddArguments();
    }

    ~ReadContentLauncherAcceptsHeaderList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050A) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ContentLauncherCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeAcceptsHeaderList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<ContentLauncherAcceptsHeaderListListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<ContentLauncherAcceptsHeaderListListAttributeCallback>(
            OnContentLauncherAcceptsHeaderListListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute SupportedStreamingTypes
 */
class ReadContentLauncherSupportedStreamingTypes : public ModelCommand
{
public:
    ReadContentLauncherSupportedStreamingTypes() : ModelCommand("read")
    {
        AddArgument("attr-name", "supported-streaming-types");
        ModelCommand::AddArguments();
    }

    ~ReadContentLauncherSupportedStreamingTypes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050A) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ContentLauncherCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeSupportedStreamingTypes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<ContentLauncherSupportedStreamingTypesListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<ContentLauncherSupportedStreamingTypesListAttributeCallback>(
            OnContentLauncherSupportedStreamingTypesListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadContentLauncherClusterRevision : public ModelCommand
{
public:
    ReadContentLauncherClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadContentLauncherClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050A) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ContentLauncherCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster Descriptor                                                  | 0x001D |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * DeviceList                                                        | 0x0000 |
| * ServerList                                                        | 0x0001 |
| * ClientList                                                        | 0x0002 |
| * PartsList                                                         | 0x0003 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Discover Attributes
 */
class DiscoverDescriptorAttributes : public ModelCommand
{
public:
    DiscoverDescriptorAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverDescriptorAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::DescriptorCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute DeviceList
 */
class ReadDescriptorDeviceList : public ModelCommand
{
public:
    ReadDescriptorDeviceList() : ModelCommand("read")
    {
        AddArgument("attr-name", "device-list");
        ModelCommand::AddArguments();
    }

    ~ReadDescriptorDeviceList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x001D) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::DescriptorCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeDeviceList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DescriptorDeviceListListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<DescriptorDeviceListListAttributeCallback>(OnDescriptorDeviceListListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ServerList
 */
class ReadDescriptorServerList : public ModelCommand
{
public:
    ReadDescriptorServerList() : ModelCommand("read")
    {
        AddArgument("attr-name", "server-list");
        ModelCommand::AddArguments();
    }

    ~ReadDescriptorServerList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x001D) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::DescriptorCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeServerList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DescriptorServerListListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<DescriptorServerListListAttributeCallback>(OnDescriptorServerListListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClientList
 */
class ReadDescriptorClientList : public ModelCommand
{
public:
    ReadDescriptorClientList() : ModelCommand("read")
    {
        AddArgument("attr-name", "client-list");
        ModelCommand::AddArguments();
    }

    ~ReadDescriptorClientList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x001D) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::DescriptorCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClientList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DescriptorClientListListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<DescriptorClientListListAttributeCallback>(OnDescriptorClientListListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute PartsList
 */
class ReadDescriptorPartsList : public ModelCommand
{
public:
    ReadDescriptorPartsList() : ModelCommand("read")
    {
        AddArgument("attr-name", "parts-list");
        ModelCommand::AddArguments();
    }

    ~ReadDescriptorPartsList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x001D) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::DescriptorCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePartsList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DescriptorPartsListListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<DescriptorPartsListListAttributeCallback>(OnDescriptorPartsListListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadDescriptorClusterRevision : public ModelCommand
{
public:
    ReadDescriptorClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadDescriptorClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x001D) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::DescriptorCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster DiagnosticLogs                                              | 0x0032 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * RetrieveLogsRequest                                               |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
\*----------------------------------------------------------------------------*/

/*
 * Command RetrieveLogsRequest
 */
class DiagnosticLogsRetrieveLogsRequest : public ModelCommand
{
public:
    DiagnosticLogsRetrieveLogsRequest() : ModelCommand("retrieve-logs-request")
    {
        AddArgument("Intent", 0, UINT8_MAX, &mIntent);
        AddArgument("RequestedProtocol", 0, UINT8_MAX, &mRequestedProtocol);
        AddArgument("TransferFileDesignator", &mTransferFileDesignator);
        ModelCommand::AddArguments();
    }
    ~DiagnosticLogsRetrieveLogsRequest()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0032) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::DiagnosticLogsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.RetrieveLogsRequest(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mIntent, mRequestedProtocol,
                                           mTransferFileDesignator);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mIntent;
    uint8_t mRequestedProtocol;
    chip::ByteSpan mTransferFileDesignator;
};

/*
 * Discover Attributes
 */
class DiscoverDiagnosticLogsAttributes : public ModelCommand
{
public:
    DiscoverDiagnosticLogsAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverDiagnosticLogsAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::DiagnosticLogsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster DoorLock                                                    | 0x0101 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * ClearAllPins                                                      |   0x08 |
| * ClearAllRfids                                                     |   0x19 |
| * ClearHolidaySchedule                                              |   0x13 |
| * ClearPin                                                          |   0x07 |
| * ClearRfid                                                         |   0x18 |
| * ClearWeekdaySchedule                                              |   0x0D |
| * ClearYeardaySchedule                                              |   0x10 |
| * GetHolidaySchedule                                                |   0x12 |
| * GetLogRecord                                                      |   0x04 |
| * GetPin                                                            |   0x06 |
| * GetRfid                                                           |   0x17 |
| * GetUserType                                                       |   0x15 |
| * GetWeekdaySchedule                                                |   0x0C |
| * GetYeardaySchedule                                                |   0x0F |
| * LockDoor                                                          |   0x00 |
| * SetHolidaySchedule                                                |   0x11 |
| * SetPin                                                            |   0x05 |
| * SetRfid                                                           |   0x16 |
| * SetUserType                                                       |   0x14 |
| * SetWeekdaySchedule                                                |   0x0B |
| * SetYeardaySchedule                                                |   0x0E |
| * UnlockDoor                                                        |   0x01 |
| * UnlockWithTimeout                                                 |   0x03 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * LockState                                                         | 0x0000 |
| * LockType                                                          | 0x0001 |
| * ActuatorEnabled                                                   | 0x0002 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command ClearAllPins
 */
class DoorLockClearAllPins : public ModelCommand
{
public:
    DoorLockClearAllPins() : ModelCommand("clear-all-pins") { ModelCommand::AddArguments(); }
    ~DoorLockClearAllPins()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x08) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ClearAllPins(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DoorLockClusterClearAllPinsResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterClearAllPinsResponseCallback>(OnDoorLockClusterClearAllPinsResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command ClearAllRfids
 */
class DoorLockClearAllRfids : public ModelCommand
{
public:
    DoorLockClearAllRfids() : ModelCommand("clear-all-rfids") { ModelCommand::AddArguments(); }
    ~DoorLockClearAllRfids()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x19) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ClearAllRfids(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DoorLockClusterClearAllRfidsResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterClearAllRfidsResponseCallback>(OnDoorLockClusterClearAllRfidsResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command ClearHolidaySchedule
 */
class DoorLockClearHolidaySchedule : public ModelCommand
{
public:
    DoorLockClearHolidaySchedule() : ModelCommand("clear-holiday-schedule")
    {
        AddArgument("ScheduleId", 0, UINT8_MAX, &mScheduleId);
        ModelCommand::AddArguments();
    }
    ~DoorLockClearHolidaySchedule()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x13) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ClearHolidaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId);
    }

private:
    chip::Callback::Callback<DoorLockClusterClearHolidayScheduleResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterClearHolidayScheduleResponseCallback>(
            OnDoorLockClusterClearHolidayScheduleResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mScheduleId;
};

/*
 * Command ClearPin
 */
class DoorLockClearPin : public ModelCommand
{
public:
    DoorLockClearPin() : ModelCommand("clear-pin")
    {
        AddArgument("UserId", 0, UINT16_MAX, &mUserId);
        ModelCommand::AddArguments();
    }
    ~DoorLockClearPin()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x07) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ClearPin(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId);
    }

private:
    chip::Callback::Callback<DoorLockClusterClearPinResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterClearPinResponseCallback>(OnDoorLockClusterClearPinResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mUserId;
};

/*
 * Command ClearRfid
 */
class DoorLockClearRfid : public ModelCommand
{
public:
    DoorLockClearRfid() : ModelCommand("clear-rfid")
    {
        AddArgument("UserId", 0, UINT16_MAX, &mUserId);
        ModelCommand::AddArguments();
    }
    ~DoorLockClearRfid()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x18) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ClearRfid(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId);
    }

private:
    chip::Callback::Callback<DoorLockClusterClearRfidResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterClearRfidResponseCallback>(OnDoorLockClusterClearRfidResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mUserId;
};

/*
 * Command ClearWeekdaySchedule
 */
class DoorLockClearWeekdaySchedule : public ModelCommand
{
public:
    DoorLockClearWeekdaySchedule() : ModelCommand("clear-weekday-schedule")
    {
        AddArgument("ScheduleId", 0, UINT8_MAX, &mScheduleId);
        AddArgument("UserId", 0, UINT16_MAX, &mUserId);
        ModelCommand::AddArguments();
    }
    ~DoorLockClearWeekdaySchedule()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x0D) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ClearWeekdaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mUserId);
    }

private:
    chip::Callback::Callback<DoorLockClusterClearWeekdayScheduleResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterClearWeekdayScheduleResponseCallback>(
            OnDoorLockClusterClearWeekdayScheduleResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mScheduleId;
    uint16_t mUserId;
};

/*
 * Command ClearYeardaySchedule
 */
class DoorLockClearYeardaySchedule : public ModelCommand
{
public:
    DoorLockClearYeardaySchedule() : ModelCommand("clear-yearday-schedule")
    {
        AddArgument("ScheduleId", 0, UINT8_MAX, &mScheduleId);
        AddArgument("UserId", 0, UINT16_MAX, &mUserId);
        ModelCommand::AddArguments();
    }
    ~DoorLockClearYeardaySchedule()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x10) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ClearYeardaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mUserId);
    }

private:
    chip::Callback::Callback<DoorLockClusterClearYeardayScheduleResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterClearYeardayScheduleResponseCallback>(
            OnDoorLockClusterClearYeardayScheduleResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mScheduleId;
    uint16_t mUserId;
};

/*
 * Command GetHolidaySchedule
 */
class DoorLockGetHolidaySchedule : public ModelCommand
{
public:
    DoorLockGetHolidaySchedule() : ModelCommand("get-holiday-schedule")
    {
        AddArgument("ScheduleId", 0, UINT8_MAX, &mScheduleId);
        ModelCommand::AddArguments();
    }
    ~DoorLockGetHolidaySchedule()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x12) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetHolidaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId);
    }

private:
    chip::Callback::Callback<DoorLockClusterGetHolidayScheduleResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterGetHolidayScheduleResponseCallback>(OnDoorLockClusterGetHolidayScheduleResponse,
                                                                                        this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mScheduleId;
};

/*
 * Command GetLogRecord
 */
class DoorLockGetLogRecord : public ModelCommand
{
public:
    DoorLockGetLogRecord() : ModelCommand("get-log-record")
    {
        AddArgument("LogIndex", 0, UINT16_MAX, &mLogIndex);
        ModelCommand::AddArguments();
    }
    ~DoorLockGetLogRecord()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x04) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetLogRecord(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mLogIndex);
    }

private:
    chip::Callback::Callback<DoorLockClusterGetLogRecordResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterGetLogRecordResponseCallback>(OnDoorLockClusterGetLogRecordResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mLogIndex;
};

/*
 * Command GetPin
 */
class DoorLockGetPin : public ModelCommand
{
public:
    DoorLockGetPin() : ModelCommand("get-pin")
    {
        AddArgument("UserId", 0, UINT16_MAX, &mUserId);
        ModelCommand::AddArguments();
    }
    ~DoorLockGetPin()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetPin(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId);
    }

private:
    chip::Callback::Callback<DoorLockClusterGetPinResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterGetPinResponseCallback>(OnDoorLockClusterGetPinResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mUserId;
};

/*
 * Command GetRfid
 */
class DoorLockGetRfid : public ModelCommand
{
public:
    DoorLockGetRfid() : ModelCommand("get-rfid")
    {
        AddArgument("UserId", 0, UINT16_MAX, &mUserId);
        ModelCommand::AddArguments();
    }
    ~DoorLockGetRfid()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x17) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetRfid(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId);
    }

private:
    chip::Callback::Callback<DoorLockClusterGetRfidResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterGetRfidResponseCallback>(OnDoorLockClusterGetRfidResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mUserId;
};

/*
 * Command GetUserType
 */
class DoorLockGetUserType : public ModelCommand
{
public:
    DoorLockGetUserType() : ModelCommand("get-user-type")
    {
        AddArgument("UserId", 0, UINT16_MAX, &mUserId);
        ModelCommand::AddArguments();
    }
    ~DoorLockGetUserType()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x15) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetUserType(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId);
    }

private:
    chip::Callback::Callback<DoorLockClusterGetUserTypeResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterGetUserTypeResponseCallback>(OnDoorLockClusterGetUserTypeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mUserId;
};

/*
 * Command GetWeekdaySchedule
 */
class DoorLockGetWeekdaySchedule : public ModelCommand
{
public:
    DoorLockGetWeekdaySchedule() : ModelCommand("get-weekday-schedule")
    {
        AddArgument("ScheduleId", 0, UINT8_MAX, &mScheduleId);
        AddArgument("UserId", 0, UINT16_MAX, &mUserId);
        ModelCommand::AddArguments();
    }
    ~DoorLockGetWeekdaySchedule()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetWeekdaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mUserId);
    }

private:
    chip::Callback::Callback<DoorLockClusterGetWeekdayScheduleResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterGetWeekdayScheduleResponseCallback>(OnDoorLockClusterGetWeekdayScheduleResponse,
                                                                                        this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mScheduleId;
    uint16_t mUserId;
};

/*
 * Command GetYeardaySchedule
 */
class DoorLockGetYeardaySchedule : public ModelCommand
{
public:
    DoorLockGetYeardaySchedule() : ModelCommand("get-yearday-schedule")
    {
        AddArgument("ScheduleId", 0, UINT8_MAX, &mScheduleId);
        AddArgument("UserId", 0, UINT16_MAX, &mUserId);
        ModelCommand::AddArguments();
    }
    ~DoorLockGetYeardaySchedule()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x0F) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetYeardaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mUserId);
    }

private:
    chip::Callback::Callback<DoorLockClusterGetYeardayScheduleResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterGetYeardayScheduleResponseCallback>(OnDoorLockClusterGetYeardayScheduleResponse,
                                                                                        this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mScheduleId;
    uint16_t mUserId;
};

/*
 * Command LockDoor
 */
class DoorLockLockDoor : public ModelCommand
{
public:
    DoorLockLockDoor() : ModelCommand("lock-door")
    {
        AddArgument("Pin", &mPin);
        ModelCommand::AddArguments();
    }
    ~DoorLockLockDoor()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.LockDoor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                chip::ByteSpan(chip::Uint8::from_char(mPin), strlen(mPin)));
    }

private:
    chip::Callback::Callback<DoorLockClusterLockDoorResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterLockDoorResponseCallback>(OnDoorLockClusterLockDoorResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mPin;
};

/*
 * Command SetHolidaySchedule
 */
class DoorLockSetHolidaySchedule : public ModelCommand
{
public:
    DoorLockSetHolidaySchedule() : ModelCommand("set-holiday-schedule")
    {
        AddArgument("ScheduleId", 0, UINT8_MAX, &mScheduleId);
        AddArgument("LocalStartTime", 0, UINT32_MAX, &mLocalStartTime);
        AddArgument("LocalEndTime", 0, UINT32_MAX, &mLocalEndTime);
        AddArgument("OperatingModeDuringHoliday", 0, UINT8_MAX, &mOperatingModeDuringHoliday);
        ModelCommand::AddArguments();
    }
    ~DoorLockSetHolidaySchedule()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x11) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SetHolidaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mLocalStartTime,
                                          mLocalEndTime, mOperatingModeDuringHoliday);
    }

private:
    chip::Callback::Callback<DoorLockClusterSetHolidayScheduleResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterSetHolidayScheduleResponseCallback>(OnDoorLockClusterSetHolidayScheduleResponse,
                                                                                        this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mScheduleId;
    uint32_t mLocalStartTime;
    uint32_t mLocalEndTime;
    uint8_t mOperatingModeDuringHoliday;
};

/*
 * Command SetPin
 */
class DoorLockSetPin : public ModelCommand
{
public:
    DoorLockSetPin() : ModelCommand("set-pin")
    {
        AddArgument("UserId", 0, UINT16_MAX, &mUserId);
        AddArgument("UserStatus", 0, UINT8_MAX, &mUserStatus);
        AddArgument("UserType", 0, UINT8_MAX, &mUserType);
        AddArgument("Pin", &mPin);
        ModelCommand::AddArguments();
    }
    ~DoorLockSetPin()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x05) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SetPin(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId, mUserStatus, mUserType,
                              chip::ByteSpan(chip::Uint8::from_char(mPin), strlen(mPin)));
    }

private:
    chip::Callback::Callback<DoorLockClusterSetPinResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterSetPinResponseCallback>(OnDoorLockClusterSetPinResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mUserId;
    uint8_t mUserStatus;
    uint8_t mUserType;
    char * mPin;
};

/*
 * Command SetRfid
 */
class DoorLockSetRfid : public ModelCommand
{
public:
    DoorLockSetRfid() : ModelCommand("set-rfid")
    {
        AddArgument("UserId", 0, UINT16_MAX, &mUserId);
        AddArgument("UserStatus", 0, UINT8_MAX, &mUserStatus);
        AddArgument("UserType", 0, UINT8_MAX, &mUserType);
        AddArgument("Id", &mId);
        ModelCommand::AddArguments();
    }
    ~DoorLockSetRfid()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x16) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SetRfid(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId, mUserStatus, mUserType,
                               chip::ByteSpan(chip::Uint8::from_char(mId), strlen(mId)));
    }

private:
    chip::Callback::Callback<DoorLockClusterSetRfidResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterSetRfidResponseCallback>(OnDoorLockClusterSetRfidResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mUserId;
    uint8_t mUserStatus;
    uint8_t mUserType;
    char * mId;
};

/*
 * Command SetUserType
 */
class DoorLockSetUserType : public ModelCommand
{
public:
    DoorLockSetUserType() : ModelCommand("set-user-type")
    {
        AddArgument("UserId", 0, UINT16_MAX, &mUserId);
        AddArgument("UserType", 0, UINT8_MAX, &mUserType);
        ModelCommand::AddArguments();
    }
    ~DoorLockSetUserType()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x14) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SetUserType(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId, mUserType);
    }

private:
    chip::Callback::Callback<DoorLockClusterSetUserTypeResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterSetUserTypeResponseCallback>(OnDoorLockClusterSetUserTypeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mUserId;
    uint8_t mUserType;
};

/*
 * Command SetWeekdaySchedule
 */
class DoorLockSetWeekdaySchedule : public ModelCommand
{
public:
    DoorLockSetWeekdaySchedule() : ModelCommand("set-weekday-schedule")
    {
        AddArgument("ScheduleId", 0, UINT8_MAX, &mScheduleId);
        AddArgument("UserId", 0, UINT16_MAX, &mUserId);
        AddArgument("DaysMask", 0, UINT8_MAX, &mDaysMask);
        AddArgument("StartHour", 0, UINT8_MAX, &mStartHour);
        AddArgument("StartMinute", 0, UINT8_MAX, &mStartMinute);
        AddArgument("EndHour", 0, UINT8_MAX, &mEndHour);
        AddArgument("EndMinute", 0, UINT8_MAX, &mEndMinute);
        ModelCommand::AddArguments();
    }
    ~DoorLockSetWeekdaySchedule()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x0B) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SetWeekdaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mUserId, mDaysMask,
                                          mStartHour, mStartMinute, mEndHour, mEndMinute);
    }

private:
    chip::Callback::Callback<DoorLockClusterSetWeekdayScheduleResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterSetWeekdayScheduleResponseCallback>(OnDoorLockClusterSetWeekdayScheduleResponse,
                                                                                        this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mScheduleId;
    uint16_t mUserId;
    uint8_t mDaysMask;
    uint8_t mStartHour;
    uint8_t mStartMinute;
    uint8_t mEndHour;
    uint8_t mEndMinute;
};

/*
 * Command SetYeardaySchedule
 */
class DoorLockSetYeardaySchedule : public ModelCommand
{
public:
    DoorLockSetYeardaySchedule() : ModelCommand("set-yearday-schedule")
    {
        AddArgument("ScheduleId", 0, UINT8_MAX, &mScheduleId);
        AddArgument("UserId", 0, UINT16_MAX, &mUserId);
        AddArgument("LocalStartTime", 0, UINT32_MAX, &mLocalStartTime);
        AddArgument("LocalEndTime", 0, UINT32_MAX, &mLocalEndTime);
        ModelCommand::AddArguments();
    }
    ~DoorLockSetYeardaySchedule()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x0E) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SetYeardaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mUserId,
                                          mLocalStartTime, mLocalEndTime);
    }

private:
    chip::Callback::Callback<DoorLockClusterSetYeardayScheduleResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterSetYeardayScheduleResponseCallback>(OnDoorLockClusterSetYeardayScheduleResponse,
                                                                                        this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mScheduleId;
    uint16_t mUserId;
    uint32_t mLocalStartTime;
    uint32_t mLocalEndTime;
};

/*
 * Command UnlockDoor
 */
class DoorLockUnlockDoor : public ModelCommand
{
public:
    DoorLockUnlockDoor() : ModelCommand("unlock-door")
    {
        AddArgument("Pin", &mPin);
        ModelCommand::AddArguments();
    }
    ~DoorLockUnlockDoor()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.UnlockDoor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                  chip::ByteSpan(chip::Uint8::from_char(mPin), strlen(mPin)));
    }

private:
    chip::Callback::Callback<DoorLockClusterUnlockDoorResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterUnlockDoorResponseCallback>(OnDoorLockClusterUnlockDoorResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mPin;
};

/*
 * Command UnlockWithTimeout
 */
class DoorLockUnlockWithTimeout : public ModelCommand
{
public:
    DoorLockUnlockWithTimeout() : ModelCommand("unlock-with-timeout")
    {
        AddArgument("TimeoutInSeconds", 0, UINT16_MAX, &mTimeoutInSeconds);
        AddArgument("Pin", &mPin);
        ModelCommand::AddArguments();
    }
    ~DoorLockUnlockWithTimeout()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x03) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.UnlockWithTimeout(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mTimeoutInSeconds,
                                         chip::ByteSpan(chip::Uint8::from_char(mPin), strlen(mPin)));
    }

private:
    chip::Callback::Callback<DoorLockClusterUnlockWithTimeoutResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterUnlockWithTimeoutResponseCallback>(OnDoorLockClusterUnlockWithTimeoutResponse,
                                                                                       this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mTimeoutInSeconds;
    char * mPin;
};

/*
 * Discover Attributes
 */
class DiscoverDoorLockAttributes : public ModelCommand
{
public:
    DiscoverDoorLockAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverDoorLockAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute LockState
 */
class ReadDoorLockLockState : public ModelCommand
{
public:
    ReadDoorLockLockState() : ModelCommand("read")
    {
        AddArgument("attr-name", "lock-state");
        ModelCommand::AddArguments();
    }

    ~ReadDoorLockLockState()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeLockState(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportDoorLockLockState : public ModelCommand
{
public:
    ReportDoorLockLockState() : ModelCommand("report")
    {
        AddArgument("attr-name", "lock-state");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        ModelCommand::AddArguments();
    }

    ~ReportDoorLockLockState()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeLockState(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeLockState(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                   mMaxInterval);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int8uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
};

/*
 * Attribute LockType
 */
class ReadDoorLockLockType : public ModelCommand
{
public:
    ReadDoorLockLockType() : ModelCommand("read")
    {
        AddArgument("attr-name", "lock-type");
        ModelCommand::AddArguments();
    }

    ~ReadDoorLockLockType()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeLockType(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ActuatorEnabled
 */
class ReadDoorLockActuatorEnabled : public ModelCommand
{
public:
    ReadDoorLockActuatorEnabled() : ModelCommand("read")
    {
        AddArgument("attr-name", "actuator-enabled");
        ModelCommand::AddArguments();
    }

    ~ReadDoorLockActuatorEnabled()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeActuatorEnabled(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<BooleanAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadDoorLockClusterRevision : public ModelCommand
{
public:
    ReadDoorLockClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadDoorLockClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster ElectricalMeasurement                                       | 0x0B04 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * MeasurementType                                                   | 0x0000 |
| * TotalActivePower                                                  | 0x0304 |
| * RmsVoltage                                                        | 0x0505 |
| * RmsVoltageMin                                                     | 0x0506 |
| * RmsVoltageMax                                                     | 0x0507 |
| * RmsCurrent                                                        | 0x0508 |
| * RmsCurrentMin                                                     | 0x0509 |
| * RmsCurrentMax                                                     | 0x050A |
| * ActivePower                                                       | 0x050B |
| * ActivePowerMin                                                    | 0x050C |
| * ActivePowerMax                                                    | 0x050D |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Discover Attributes
 */
class DiscoverElectricalMeasurementAttributes : public ModelCommand
{
public:
    DiscoverElectricalMeasurementAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverElectricalMeasurementAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::ElectricalMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute MeasurementType
 */
class ReadElectricalMeasurementMeasurementType : public ModelCommand
{
public:
    ReadElectricalMeasurementMeasurementType() : ModelCommand("read")
    {
        AddArgument("attr-name", "measurement-type");
        ModelCommand::AddArguments();
    }

    ~ReadElectricalMeasurementMeasurementType()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0B04) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ElectricalMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMeasurementType(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute TotalActivePower
 */
class ReadElectricalMeasurementTotalActivePower : public ModelCommand
{
public:
    ReadElectricalMeasurementTotalActivePower() : ModelCommand("read")
    {
        AddArgument("attr-name", "total-active-power");
        ModelCommand::AddArguments();
    }

    ~ReadElectricalMeasurementTotalActivePower()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0B04) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ElectricalMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTotalActivePower(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32sAttributeCallback>(OnInt32sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RmsVoltage
 */
class ReadElectricalMeasurementRmsVoltage : public ModelCommand
{
public:
    ReadElectricalMeasurementRmsVoltage() : ModelCommand("read")
    {
        AddArgument("attr-name", "rms-voltage");
        ModelCommand::AddArguments();
    }

    ~ReadElectricalMeasurementRmsVoltage()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0B04) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ElectricalMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRmsVoltage(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RmsVoltageMin
 */
class ReadElectricalMeasurementRmsVoltageMin : public ModelCommand
{
public:
    ReadElectricalMeasurementRmsVoltageMin() : ModelCommand("read")
    {
        AddArgument("attr-name", "rms-voltage-min");
        ModelCommand::AddArguments();
    }

    ~ReadElectricalMeasurementRmsVoltageMin()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0B04) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ElectricalMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRmsVoltageMin(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RmsVoltageMax
 */
class ReadElectricalMeasurementRmsVoltageMax : public ModelCommand
{
public:
    ReadElectricalMeasurementRmsVoltageMax() : ModelCommand("read")
    {
        AddArgument("attr-name", "rms-voltage-max");
        ModelCommand::AddArguments();
    }

    ~ReadElectricalMeasurementRmsVoltageMax()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0B04) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ElectricalMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRmsVoltageMax(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RmsCurrent
 */
class ReadElectricalMeasurementRmsCurrent : public ModelCommand
{
public:
    ReadElectricalMeasurementRmsCurrent() : ModelCommand("read")
    {
        AddArgument("attr-name", "rms-current");
        ModelCommand::AddArguments();
    }

    ~ReadElectricalMeasurementRmsCurrent()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0B04) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ElectricalMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRmsCurrent(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RmsCurrentMin
 */
class ReadElectricalMeasurementRmsCurrentMin : public ModelCommand
{
public:
    ReadElectricalMeasurementRmsCurrentMin() : ModelCommand("read")
    {
        AddArgument("attr-name", "rms-current-min");
        ModelCommand::AddArguments();
    }

    ~ReadElectricalMeasurementRmsCurrentMin()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0B04) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ElectricalMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRmsCurrentMin(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RmsCurrentMax
 */
class ReadElectricalMeasurementRmsCurrentMax : public ModelCommand
{
public:
    ReadElectricalMeasurementRmsCurrentMax() : ModelCommand("read")
    {
        AddArgument("attr-name", "rms-current-max");
        ModelCommand::AddArguments();
    }

    ~ReadElectricalMeasurementRmsCurrentMax()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0B04) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ElectricalMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRmsCurrentMax(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ActivePower
 */
class ReadElectricalMeasurementActivePower : public ModelCommand
{
public:
    ReadElectricalMeasurementActivePower() : ModelCommand("read")
    {
        AddArgument("attr-name", "active-power");
        ModelCommand::AddArguments();
    }

    ~ReadElectricalMeasurementActivePower()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0B04) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ElectricalMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeActivePower(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ActivePowerMin
 */
class ReadElectricalMeasurementActivePowerMin : public ModelCommand
{
public:
    ReadElectricalMeasurementActivePowerMin() : ModelCommand("read")
    {
        AddArgument("attr-name", "active-power-min");
        ModelCommand::AddArguments();
    }

    ~ReadElectricalMeasurementActivePowerMin()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0B04) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ElectricalMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeActivePowerMin(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ActivePowerMax
 */
class ReadElectricalMeasurementActivePowerMax : public ModelCommand
{
public:
    ReadElectricalMeasurementActivePowerMax() : ModelCommand("read")
    {
        AddArgument("attr-name", "active-power-max");
        ModelCommand::AddArguments();
    }

    ~ReadElectricalMeasurementActivePowerMax()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0B04) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ElectricalMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeActivePowerMax(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadElectricalMeasurementClusterRevision : public ModelCommand
{
public:
    ReadElectricalMeasurementClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadElectricalMeasurementClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0B04) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ElectricalMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster EthernetNetworkDiagnostics                                  | 0x0037 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * ResetCounts                                                       |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * PacketRxCount                                                     | 0x0002 |
| * PacketTxCount                                                     | 0x0003 |
| * TxErrCount                                                        | 0x0004 |
| * CollisionCount                                                    | 0x0005 |
| * OverrunCount                                                      | 0x0006 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command ResetCounts
 */
class EthernetNetworkDiagnosticsResetCounts : public ModelCommand
{
public:
    EthernetNetworkDiagnosticsResetCounts() : ModelCommand("reset-counts") { ModelCommand::AddArguments(); }
    ~EthernetNetworkDiagnosticsResetCounts()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0037) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::EthernetNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ResetCounts(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Discover Attributes
 */
class DiscoverEthernetNetworkDiagnosticsAttributes : public ModelCommand
{
public:
    DiscoverEthernetNetworkDiagnosticsAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverEthernetNetworkDiagnosticsAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::EthernetNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute PacketRxCount
 */
class ReadEthernetNetworkDiagnosticsPacketRxCount : public ModelCommand
{
public:
    ReadEthernetNetworkDiagnosticsPacketRxCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "packet-rx-count");
        ModelCommand::AddArguments();
    }

    ~ReadEthernetNetworkDiagnosticsPacketRxCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0037) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::EthernetNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePacketRxCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int64uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int64uAttributeCallback>(OnInt64uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute PacketTxCount
 */
class ReadEthernetNetworkDiagnosticsPacketTxCount : public ModelCommand
{
public:
    ReadEthernetNetworkDiagnosticsPacketTxCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "packet-tx-count");
        ModelCommand::AddArguments();
    }

    ~ReadEthernetNetworkDiagnosticsPacketTxCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0037) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::EthernetNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePacketTxCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int64uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int64uAttributeCallback>(OnInt64uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute TxErrCount
 */
class ReadEthernetNetworkDiagnosticsTxErrCount : public ModelCommand
{
public:
    ReadEthernetNetworkDiagnosticsTxErrCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "tx-err-count");
        ModelCommand::AddArguments();
    }

    ~ReadEthernetNetworkDiagnosticsTxErrCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0037) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::EthernetNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTxErrCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int64uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int64uAttributeCallback>(OnInt64uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CollisionCount
 */
class ReadEthernetNetworkDiagnosticsCollisionCount : public ModelCommand
{
public:
    ReadEthernetNetworkDiagnosticsCollisionCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "collision-count");
        ModelCommand::AddArguments();
    }

    ~ReadEthernetNetworkDiagnosticsCollisionCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0037) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::EthernetNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCollisionCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int64uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int64uAttributeCallback>(OnInt64uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute OverrunCount
 */
class ReadEthernetNetworkDiagnosticsOverrunCount : public ModelCommand
{
public:
    ReadEthernetNetworkDiagnosticsOverrunCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "overrun-count");
        ModelCommand::AddArguments();
    }

    ~ReadEthernetNetworkDiagnosticsOverrunCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0037) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::EthernetNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeOverrunCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int64uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int64uAttributeCallback>(OnInt64uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadEthernetNetworkDiagnosticsClusterRevision : public ModelCommand
{
public:
    ReadEthernetNetworkDiagnosticsClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadEthernetNetworkDiagnosticsClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0037) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::EthernetNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster FixedLabel                                                  | 0x0040 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * LabelList                                                         | 0x0000 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Discover Attributes
 */
class DiscoverFixedLabelAttributes : public ModelCommand
{
public:
    DiscoverFixedLabelAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverFixedLabelAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::FixedLabelCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute LabelList
 */
class ReadFixedLabelLabelList : public ModelCommand
{
public:
    ReadFixedLabelLabelList() : ModelCommand("read")
    {
        AddArgument("attr-name", "label-list");
        ModelCommand::AddArguments();
    }

    ~ReadFixedLabelLabelList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0040) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::FixedLabelCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeLabelList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<FixedLabelLabelListListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<FixedLabelLabelListListAttributeCallback>(OnFixedLabelLabelListListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadFixedLabelClusterRevision : public ModelCommand
{
public:
    ReadFixedLabelClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadFixedLabelClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0040) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::FixedLabelCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster FlowMeasurement                                             | 0x0404 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * MeasuredValue                                                     | 0x0000 |
| * MinMeasuredValue                                                  | 0x0001 |
| * MaxMeasuredValue                                                  | 0x0002 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Discover Attributes
 */
class DiscoverFlowMeasurementAttributes : public ModelCommand
{
public:
    DiscoverFlowMeasurementAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverFlowMeasurementAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::FlowMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute MeasuredValue
 */
class ReadFlowMeasurementMeasuredValue : public ModelCommand
{
public:
    ReadFlowMeasurementMeasuredValue() : ModelCommand("read")
    {
        AddArgument("attr-name", "measured-value");
        ModelCommand::AddArguments();
    }

    ~ReadFlowMeasurementMeasuredValue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0404) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::FlowMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute MinMeasuredValue
 */
class ReadFlowMeasurementMinMeasuredValue : public ModelCommand
{
public:
    ReadFlowMeasurementMinMeasuredValue() : ModelCommand("read")
    {
        AddArgument("attr-name", "min-measured-value");
        ModelCommand::AddArguments();
    }

    ~ReadFlowMeasurementMinMeasuredValue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0404) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::FlowMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMinMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute MaxMeasuredValue
 */
class ReadFlowMeasurementMaxMeasuredValue : public ModelCommand
{
public:
    ReadFlowMeasurementMaxMeasuredValue() : ModelCommand("read")
    {
        AddArgument("attr-name", "max-measured-value");
        ModelCommand::AddArguments();
    }

    ~ReadFlowMeasurementMaxMeasuredValue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0404) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::FlowMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMaxMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadFlowMeasurementClusterRevision : public ModelCommand
{
public:
    ReadFlowMeasurementClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadFlowMeasurementClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0404) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::FlowMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster GeneralCommissioning                                        | 0x0030 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * ArmFailSafe                                                       |   0x00 |
| * CommissioningComplete                                             |   0x04 |
| * SetRegulatoryConfig                                               |   0x02 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * FabricId                                                          | 0x0000 |
| * Breadcrumb                                                        | 0x0001 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command ArmFailSafe
 */
class GeneralCommissioningArmFailSafe : public ModelCommand
{
public:
    GeneralCommissioningArmFailSafe() : ModelCommand("arm-fail-safe")
    {
        AddArgument("ExpiryLengthSeconds", 0, UINT16_MAX, &mExpiryLengthSeconds);
        AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb);
        AddArgument("TimeoutMs", 0, UINT32_MAX, &mTimeoutMs);
        ModelCommand::AddArguments();
    }
    ~GeneralCommissioningArmFailSafe()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::GeneralCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ArmFailSafe(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mExpiryLengthSeconds, mBreadcrumb,
                                   mTimeoutMs);
    }

private:
    chip::Callback::Callback<GeneralCommissioningClusterArmFailSafeResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<GeneralCommissioningClusterArmFailSafeResponseCallback>(
            OnGeneralCommissioningClusterArmFailSafeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mExpiryLengthSeconds;
    uint64_t mBreadcrumb;
    uint32_t mTimeoutMs;
};

/*
 * Command CommissioningComplete
 */
class GeneralCommissioningCommissioningComplete : public ModelCommand
{
public:
    GeneralCommissioningCommissioningComplete() : ModelCommand("commissioning-complete") { ModelCommand::AddArguments(); }
    ~GeneralCommissioningCommissioningComplete()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x04) on endpoint %" PRIu8, endpointId);

        chip::Controller::GeneralCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.CommissioningComplete(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<GeneralCommissioningClusterCommissioningCompleteResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<GeneralCommissioningClusterCommissioningCompleteResponseCallback>(
            OnGeneralCommissioningClusterCommissioningCompleteResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command SetRegulatoryConfig
 */
class GeneralCommissioningSetRegulatoryConfig : public ModelCommand
{
public:
    GeneralCommissioningSetRegulatoryConfig() : ModelCommand("set-regulatory-config")
    {
        AddArgument("Location", 0, UINT8_MAX, &mLocation);
        AddArgument("CountryCode", &mCountryCode);
        AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb);
        AddArgument("TimeoutMs", 0, UINT32_MAX, &mTimeoutMs);
        ModelCommand::AddArguments();
    }
    ~GeneralCommissioningSetRegulatoryConfig()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x02) on endpoint %" PRIu8, endpointId);

        chip::Controller::GeneralCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SetRegulatoryConfig(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mLocation,
                                           chip::ByteSpan(chip::Uint8::from_char(mCountryCode), strlen(mCountryCode)), mBreadcrumb,
                                           mTimeoutMs);
    }

private:
    chip::Callback::Callback<GeneralCommissioningClusterSetRegulatoryConfigResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<GeneralCommissioningClusterSetRegulatoryConfigResponseCallback>(
            OnGeneralCommissioningClusterSetRegulatoryConfigResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mLocation;
    char * mCountryCode;
    uint64_t mBreadcrumb;
    uint32_t mTimeoutMs;
};

/*
 * Discover Attributes
 */
class DiscoverGeneralCommissioningAttributes : public ModelCommand
{
public:
    DiscoverGeneralCommissioningAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverGeneralCommissioningAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::GeneralCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute FabricId
 */
class ReadGeneralCommissioningFabricId : public ModelCommand
{
public:
    ReadGeneralCommissioningFabricId() : ModelCommand("read")
    {
        AddArgument("attr-name", "fabric-id");
        ModelCommand::AddArguments();
    }

    ~ReadGeneralCommissioningFabricId()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::GeneralCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeFabricId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Breadcrumb
 */
class ReadGeneralCommissioningBreadcrumb : public ModelCommand
{
public:
    ReadGeneralCommissioningBreadcrumb() : ModelCommand("read")
    {
        AddArgument("attr-name", "breadcrumb");
        ModelCommand::AddArguments();
    }

    ~ReadGeneralCommissioningBreadcrumb()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::GeneralCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeBreadcrumb(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int64uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int64uAttributeCallback>(OnInt64uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteGeneralCommissioningBreadcrumb : public ModelCommand
{
public:
    WriteGeneralCommissioningBreadcrumb() : ModelCommand("write")
    {
        AddArgument("attr-name", "breadcrumb");
        AddArgument("attr-value", 0, UINT64_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteGeneralCommissioningBreadcrumb()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::GeneralCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeBreadcrumb(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint64_t mValue;
};

/*
 * Attribute ClusterRevision
 */
class ReadGeneralCommissioningClusterRevision : public ModelCommand
{
public:
    ReadGeneralCommissioningClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadGeneralCommissioningClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::GeneralCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster GeneralDiagnostics                                          | 0x0033 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * NetworkInterfaces                                                 | 0x0000 |
| * RebootCount                                                       | 0x0001 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Discover Attributes
 */
class DiscoverGeneralDiagnosticsAttributes : public ModelCommand
{
public:
    DiscoverGeneralDiagnosticsAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverGeneralDiagnosticsAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::GeneralDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute NetworkInterfaces
 */
class ReadGeneralDiagnosticsNetworkInterfaces : public ModelCommand
{
public:
    ReadGeneralDiagnosticsNetworkInterfaces() : ModelCommand("read")
    {
        AddArgument("attr-name", "network-interfaces");
        ModelCommand::AddArguments();
    }

    ~ReadGeneralDiagnosticsNetworkInterfaces()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0033) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::GeneralDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeNetworkInterfaces(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<GeneralDiagnosticsNetworkInterfacesListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<GeneralDiagnosticsNetworkInterfacesListAttributeCallback>(
            OnGeneralDiagnosticsNetworkInterfacesListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RebootCount
 */
class ReadGeneralDiagnosticsRebootCount : public ModelCommand
{
public:
    ReadGeneralDiagnosticsRebootCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "reboot-count");
        ModelCommand::AddArguments();
    }

    ~ReadGeneralDiagnosticsRebootCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0033) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::GeneralDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRebootCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadGeneralDiagnosticsClusterRevision : public ModelCommand
{
public:
    ReadGeneralDiagnosticsClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadGeneralDiagnosticsClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0033) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::GeneralDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster GroupKeyManagement                                          | 0xF004 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * Groups                                                            | 0x0000 |
| * GroupKeys                                                         | 0x0001 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Discover Attributes
 */
class DiscoverGroupKeyManagementAttributes : public ModelCommand
{
public:
    DiscoverGroupKeyManagementAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverGroupKeyManagementAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::GroupKeyManagementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Groups
 */
class ReadGroupKeyManagementGroups : public ModelCommand
{
public:
    ReadGroupKeyManagementGroups() : ModelCommand("read")
    {
        AddArgument("attr-name", "groups");
        ModelCommand::AddArguments();
    }

    ~ReadGroupKeyManagementGroups()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0xF004) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::GroupKeyManagementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeGroups(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<GroupKeyManagementGroupsListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<GroupKeyManagementGroupsListAttributeCallback>(OnGroupKeyManagementGroupsListAttributeResponse,
                                                                                    this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute GroupKeys
 */
class ReadGroupKeyManagementGroupKeys : public ModelCommand
{
public:
    ReadGroupKeyManagementGroupKeys() : ModelCommand("read")
    {
        AddArgument("attr-name", "group-keys");
        ModelCommand::AddArguments();
    }

    ~ReadGroupKeyManagementGroupKeys()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0xF004) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::GroupKeyManagementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeGroupKeys(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<GroupKeyManagementGroupKeysListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<GroupKeyManagementGroupKeysListAttributeCallback>(
            OnGroupKeyManagementGroupKeysListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadGroupKeyManagementClusterRevision : public ModelCommand
{
public:
    ReadGroupKeyManagementClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadGroupKeyManagementClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0xF004) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::GroupKeyManagementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster Groups                                                      | 0x0004 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * AddGroup                                                          |   0x00 |
| * AddGroupIfIdentifying                                             |   0x05 |
| * GetGroupMembership                                                |   0x02 |
| * RemoveAllGroups                                                   |   0x04 |
| * RemoveGroup                                                       |   0x03 |
| * ViewGroup                                                         |   0x01 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * NameSupport                                                       | 0x0000 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command AddGroup
 */
class GroupsAddGroup : public ModelCommand
{
public:
    GroupsAddGroup() : ModelCommand("add-group")
    {
        AddArgument("GroupId", 0, UINT16_MAX, &mGroupId);
        AddArgument("GroupName", &mGroupName);
        ModelCommand::AddArguments();
    }
    ~GroupsAddGroup()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::GroupsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.AddGroup(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId,
                                chip::ByteSpan(chip::Uint8::from_char(mGroupName), strlen(mGroupName)));
    }

private:
    chip::Callback::Callback<GroupsClusterAddGroupResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<GroupsClusterAddGroupResponseCallback>(OnGroupsClusterAddGroupResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mGroupId;
    char * mGroupName;
};

/*
 * Command AddGroupIfIdentifying
 */
class GroupsAddGroupIfIdentifying : public ModelCommand
{
public:
    GroupsAddGroupIfIdentifying() : ModelCommand("add-group-if-identifying")
    {
        AddArgument("GroupId", 0, UINT16_MAX, &mGroupId);
        AddArgument("GroupName", &mGroupName);
        ModelCommand::AddArguments();
    }
    ~GroupsAddGroupIfIdentifying()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x05) on endpoint %" PRIu8, endpointId);

        chip::Controller::GroupsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.AddGroupIfIdentifying(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId,
                                             chip::ByteSpan(chip::Uint8::from_char(mGroupName), strlen(mGroupName)));
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mGroupId;
    char * mGroupName;
};

/*
 * Command GetGroupMembership
 */
class GroupsGetGroupMembership : public ModelCommand
{
public:
    GroupsGetGroupMembership() : ModelCommand("get-group-membership")
    {
        AddArgument("GroupCount", 0, UINT8_MAX, &mGroupCount);
        AddArgument("GroupList", 0, UINT16_MAX, &mGroupList);
        ModelCommand::AddArguments();
    }
    ~GroupsGetGroupMembership()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x02) on endpoint %" PRIu8, endpointId);

        chip::Controller::GroupsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetGroupMembership(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupCount, mGroupList);
    }

private:
    chip::Callback::Callback<GroupsClusterGetGroupMembershipResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<GroupsClusterGetGroupMembershipResponseCallback>(OnGroupsClusterGetGroupMembershipResponse,
                                                                                      this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mGroupCount;
    uint16_t mGroupList;
};

/*
 * Command RemoveAllGroups
 */
class GroupsRemoveAllGroups : public ModelCommand
{
public:
    GroupsRemoveAllGroups() : ModelCommand("remove-all-groups") { ModelCommand::AddArguments(); }
    ~GroupsRemoveAllGroups()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x04) on endpoint %" PRIu8, endpointId);

        chip::Controller::GroupsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.RemoveAllGroups(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command RemoveGroup
 */
class GroupsRemoveGroup : public ModelCommand
{
public:
    GroupsRemoveGroup() : ModelCommand("remove-group")
    {
        AddArgument("GroupId", 0, UINT16_MAX, &mGroupId);
        ModelCommand::AddArguments();
    }
    ~GroupsRemoveGroup()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x03) on endpoint %" PRIu8, endpointId);

        chip::Controller::GroupsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.RemoveGroup(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId);
    }

private:
    chip::Callback::Callback<GroupsClusterRemoveGroupResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<GroupsClusterRemoveGroupResponseCallback>(OnGroupsClusterRemoveGroupResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mGroupId;
};

/*
 * Command ViewGroup
 */
class GroupsViewGroup : public ModelCommand
{
public:
    GroupsViewGroup() : ModelCommand("view-group")
    {
        AddArgument("GroupId", 0, UINT16_MAX, &mGroupId);
        ModelCommand::AddArguments();
    }
    ~GroupsViewGroup()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::GroupsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ViewGroup(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId);
    }

private:
    chip::Callback::Callback<GroupsClusterViewGroupResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<GroupsClusterViewGroupResponseCallback>(OnGroupsClusterViewGroupResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mGroupId;
};

/*
 * Discover Attributes
 */
class DiscoverGroupsAttributes : public ModelCommand
{
public:
    DiscoverGroupsAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverGroupsAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::GroupsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute NameSupport
 */
class ReadGroupsNameSupport : public ModelCommand
{
public:
    ReadGroupsNameSupport() : ModelCommand("read")
    {
        AddArgument("attr-name", "name-support");
        ModelCommand::AddArguments();
    }

    ~ReadGroupsNameSupport()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::GroupsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeNameSupport(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadGroupsClusterRevision : public ModelCommand
{
public:
    ReadGroupsClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadGroupsClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::GroupsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster Identify                                                    | 0x0003 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * Identify                                                          |   0x00 |
| * IdentifyQuery                                                     |   0x01 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * IdentifyTime                                                      | 0x0000 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command Identify
 */
class IdentifyIdentify : public ModelCommand
{
public:
    IdentifyIdentify() : ModelCommand("identify")
    {
        AddArgument("IdentifyTime", 0, UINT16_MAX, &mIdentifyTime);
        ModelCommand::AddArguments();
    }
    ~IdentifyIdentify()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0003) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::IdentifyCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.Identify(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mIdentifyTime);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mIdentifyTime;
};

/*
 * Command IdentifyQuery
 */
class IdentifyIdentifyQuery : public ModelCommand
{
public:
    IdentifyIdentifyQuery() : ModelCommand("identify-query") { ModelCommand::AddArguments(); }
    ~IdentifyIdentifyQuery()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0003) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::IdentifyCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.IdentifyQuery(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<IdentifyClusterIdentifyQueryResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<IdentifyClusterIdentifyQueryResponseCallback>(OnIdentifyClusterIdentifyQueryResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Discover Attributes
 */
class DiscoverIdentifyAttributes : public ModelCommand
{
public:
    DiscoverIdentifyAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverIdentifyAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::IdentifyCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute IdentifyTime
 */
class ReadIdentifyIdentifyTime : public ModelCommand
{
public:
    ReadIdentifyIdentifyTime() : ModelCommand("read")
    {
        AddArgument("attr-name", "identify-time");
        ModelCommand::AddArguments();
    }

    ~ReadIdentifyIdentifyTime()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0003) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::IdentifyCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeIdentifyTime(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteIdentifyIdentifyTime : public ModelCommand
{
public:
    WriteIdentifyIdentifyTime() : ModelCommand("write")
    {
        AddArgument("attr-name", "identify-time");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteIdentifyIdentifyTime()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0003) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::IdentifyCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeIdentifyTime(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute ClusterRevision
 */
class ReadIdentifyClusterRevision : public ModelCommand
{
public:
    ReadIdentifyClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadIdentifyClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0003) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::IdentifyCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster KeypadInput                                                 | 0x0509 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * SendKey                                                           |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command SendKey
 */
class KeypadInputSendKey : public ModelCommand
{
public:
    KeypadInputSendKey() : ModelCommand("send-key")
    {
        AddArgument("KeyCode", 0, UINT8_MAX, &mKeyCode);
        ModelCommand::AddArguments();
    }
    ~KeypadInputSendKey()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0509) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::KeypadInputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SendKey(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mKeyCode);
    }

private:
    chip::Callback::Callback<KeypadInputClusterSendKeyResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<KeypadInputClusterSendKeyResponseCallback>(OnKeypadInputClusterSendKeyResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mKeyCode;
};

/*
 * Discover Attributes
 */
class DiscoverKeypadInputAttributes : public ModelCommand
{
public:
    DiscoverKeypadInputAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverKeypadInputAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::KeypadInputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadKeypadInputClusterRevision : public ModelCommand
{
public:
    ReadKeypadInputClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadKeypadInputClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0509) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::KeypadInputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster LevelControl                                                | 0x0008 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * Move                                                              |   0x01 |
| * MoveToLevel                                                       |   0x00 |
| * MoveToLevelWithOnOff                                              |   0x04 |
| * MoveWithOnOff                                                     |   0x05 |
| * Step                                                              |   0x02 |
| * StepWithOnOff                                                     |   0x06 |
| * Stop                                                              |   0x03 |
| * StopWithOnOff                                                     |   0x07 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * CurrentLevel                                                      | 0x0000 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command Move
 */
class LevelControlMove : public ModelCommand
{
public:
    LevelControlMove() : ModelCommand("move")
    {
        AddArgument("MoveMode", 0, UINT8_MAX, &mMoveMode);
        AddArgument("Rate", 0, UINT8_MAX, &mRate);
        AddArgument("OptionMask", 0, UINT8_MAX, &mOptionMask);
        AddArgument("OptionOverride", 0, UINT8_MAX, &mOptionOverride);
        ModelCommand::AddArguments();
    }
    ~LevelControlMove()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::LevelControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.Move(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMoveMode, mRate, mOptionMask,
                            mOptionOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mMoveMode;
    uint8_t mRate;
    uint8_t mOptionMask;
    uint8_t mOptionOverride;
};

/*
 * Command MoveToLevel
 */
class LevelControlMoveToLevel : public ModelCommand
{
public:
    LevelControlMoveToLevel() : ModelCommand("move-to-level")
    {
        AddArgument("Level", 0, UINT8_MAX, &mLevel);
        AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime);
        AddArgument("OptionMask", 0, UINT8_MAX, &mOptionMask);
        AddArgument("OptionOverride", 0, UINT8_MAX, &mOptionOverride);
        ModelCommand::AddArguments();
    }
    ~LevelControlMoveToLevel()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::LevelControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MoveToLevel(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mLevel, mTransitionTime, mOptionMask,
                                   mOptionOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mLevel;
    uint16_t mTransitionTime;
    uint8_t mOptionMask;
    uint8_t mOptionOverride;
};

/*
 * Command MoveToLevelWithOnOff
 */
class LevelControlMoveToLevelWithOnOff : public ModelCommand
{
public:
    LevelControlMoveToLevelWithOnOff() : ModelCommand("move-to-level-with-on-off")
    {
        AddArgument("Level", 0, UINT8_MAX, &mLevel);
        AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime);
        ModelCommand::AddArguments();
    }
    ~LevelControlMoveToLevelWithOnOff()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x04) on endpoint %" PRIu8, endpointId);

        chip::Controller::LevelControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MoveToLevelWithOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mLevel, mTransitionTime);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mLevel;
    uint16_t mTransitionTime;
};

/*
 * Command MoveWithOnOff
 */
class LevelControlMoveWithOnOff : public ModelCommand
{
public:
    LevelControlMoveWithOnOff() : ModelCommand("move-with-on-off")
    {
        AddArgument("MoveMode", 0, UINT8_MAX, &mMoveMode);
        AddArgument("Rate", 0, UINT8_MAX, &mRate);
        ModelCommand::AddArguments();
    }
    ~LevelControlMoveWithOnOff()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x05) on endpoint %" PRIu8, endpointId);

        chip::Controller::LevelControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MoveWithOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMoveMode, mRate);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mMoveMode;
    uint8_t mRate;
};

/*
 * Command Step
 */
class LevelControlStep : public ModelCommand
{
public:
    LevelControlStep() : ModelCommand("step")
    {
        AddArgument("StepMode", 0, UINT8_MAX, &mStepMode);
        AddArgument("StepSize", 0, UINT8_MAX, &mStepSize);
        AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime);
        AddArgument("OptionMask", 0, UINT8_MAX, &mOptionMask);
        AddArgument("OptionOverride", 0, UINT8_MAX, &mOptionOverride);
        ModelCommand::AddArguments();
    }
    ~LevelControlStep()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x02) on endpoint %" PRIu8, endpointId);

        chip::Controller::LevelControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.Step(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStepMode, mStepSize, mTransitionTime,
                            mOptionMask, mOptionOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mStepMode;
    uint8_t mStepSize;
    uint16_t mTransitionTime;
    uint8_t mOptionMask;
    uint8_t mOptionOverride;
};

/*
 * Command StepWithOnOff
 */
class LevelControlStepWithOnOff : public ModelCommand
{
public:
    LevelControlStepWithOnOff() : ModelCommand("step-with-on-off")
    {
        AddArgument("StepMode", 0, UINT8_MAX, &mStepMode);
        AddArgument("StepSize", 0, UINT8_MAX, &mStepSize);
        AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime);
        ModelCommand::AddArguments();
    }
    ~LevelControlStepWithOnOff()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::LevelControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.StepWithOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStepMode, mStepSize,
                                     mTransitionTime);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mStepMode;
    uint8_t mStepSize;
    uint16_t mTransitionTime;
};

/*
 * Command Stop
 */
class LevelControlStop : public ModelCommand
{
public:
    LevelControlStop() : ModelCommand("stop")
    {
        AddArgument("OptionMask", 0, UINT8_MAX, &mOptionMask);
        AddArgument("OptionOverride", 0, UINT8_MAX, &mOptionOverride);
        ModelCommand::AddArguments();
    }
    ~LevelControlStop()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x03) on endpoint %" PRIu8, endpointId);

        chip::Controller::LevelControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.Stop(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mOptionMask, mOptionOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mOptionMask;
    uint8_t mOptionOverride;
};

/*
 * Command StopWithOnOff
 */
class LevelControlStopWithOnOff : public ModelCommand
{
public:
    LevelControlStopWithOnOff() : ModelCommand("stop-with-on-off") { ModelCommand::AddArguments(); }
    ~LevelControlStopWithOnOff()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x07) on endpoint %" PRIu8, endpointId);

        chip::Controller::LevelControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.StopWithOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Discover Attributes
 */
class DiscoverLevelControlAttributes : public ModelCommand
{
public:
    DiscoverLevelControlAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverLevelControlAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::LevelControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CurrentLevel
 */
class ReadLevelControlCurrentLevel : public ModelCommand
{
public:
    ReadLevelControlCurrentLevel() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-level");
        ModelCommand::AddArguments();
    }

    ~ReadLevelControlCurrentLevel()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::LevelControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentLevel(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportLevelControlCurrentLevel : public ModelCommand
{
public:
    ReportLevelControlCurrentLevel() : ModelCommand("report")
    {
        AddArgument("attr-name", "current-level");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", 0, UINT8_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportLevelControlCurrentLevel()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::LevelControlCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeCurrentLevel(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeCurrentLevel(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                      mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int8uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    uint8_t mChange;
};

/*
 * Attribute ClusterRevision
 */
class ReadLevelControlClusterRevision : public ModelCommand
{
public:
    ReadLevelControlClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadLevelControlClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::LevelControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster LowPower                                                    | 0x0508 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * Sleep                                                             |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command Sleep
 */
class LowPowerSleep : public ModelCommand
{
public:
    LowPowerSleep() : ModelCommand("sleep") { ModelCommand::AddArguments(); }
    ~LowPowerSleep()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0508) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::LowPowerCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.Sleep(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Discover Attributes
 */
class DiscoverLowPowerAttributes : public ModelCommand
{
public:
    DiscoverLowPowerAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverLowPowerAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::LowPowerCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadLowPowerClusterRevision : public ModelCommand
{
public:
    ReadLowPowerClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadLowPowerClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0508) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::LowPowerCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster MediaInput                                                  | 0x0507 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * HideInputStatus                                                   |   0x02 |
| * RenameInput                                                       |   0x03 |
| * SelectInput                                                       |   0x00 |
| * ShowInputStatus                                                   |   0x01 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * MediaInputList                                                    | 0x0000 |
| * CurrentMediaInput                                                 | 0x0001 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command HideInputStatus
 */
class MediaInputHideInputStatus : public ModelCommand
{
public:
    MediaInputHideInputStatus() : ModelCommand("hide-input-status") { ModelCommand::AddArguments(); }
    ~MediaInputHideInputStatus()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0507) command (0x02) on endpoint %" PRIu8, endpointId);

        chip::Controller::MediaInputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.HideInputStatus(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command RenameInput
 */
class MediaInputRenameInput : public ModelCommand
{
public:
    MediaInputRenameInput() : ModelCommand("rename-input")
    {
        AddArgument("Index", 0, UINT8_MAX, &mIndex);
        AddArgument("Name", &mName);
        ModelCommand::AddArguments();
    }
    ~MediaInputRenameInput()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0507) command (0x03) on endpoint %" PRIu8, endpointId);

        chip::Controller::MediaInputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.RenameInput(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mIndex,
                                   chip::ByteSpan(chip::Uint8::from_char(mName), strlen(mName)));
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mIndex;
    char * mName;
};

/*
 * Command SelectInput
 */
class MediaInputSelectInput : public ModelCommand
{
public:
    MediaInputSelectInput() : ModelCommand("select-input")
    {
        AddArgument("Index", 0, UINT8_MAX, &mIndex);
        ModelCommand::AddArguments();
    }
    ~MediaInputSelectInput()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0507) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::MediaInputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SelectInput(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mIndex);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mIndex;
};

/*
 * Command ShowInputStatus
 */
class MediaInputShowInputStatus : public ModelCommand
{
public:
    MediaInputShowInputStatus() : ModelCommand("show-input-status") { ModelCommand::AddArguments(); }
    ~MediaInputShowInputStatus()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0507) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::MediaInputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ShowInputStatus(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Discover Attributes
 */
class DiscoverMediaInputAttributes : public ModelCommand
{
public:
    DiscoverMediaInputAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverMediaInputAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::MediaInputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute MediaInputList
 */
class ReadMediaInputMediaInputList : public ModelCommand
{
public:
    ReadMediaInputMediaInputList() : ModelCommand("read")
    {
        AddArgument("attr-name", "media-input-list");
        ModelCommand::AddArguments();
    }

    ~ReadMediaInputMediaInputList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0507) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::MediaInputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMediaInputList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<MediaInputMediaInputListListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<MediaInputMediaInputListListAttributeCallback>(OnMediaInputMediaInputListListAttributeResponse,
                                                                                    this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CurrentMediaInput
 */
class ReadMediaInputCurrentMediaInput : public ModelCommand
{
public:
    ReadMediaInputCurrentMediaInput() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-media-input");
        ModelCommand::AddArguments();
    }

    ~ReadMediaInputCurrentMediaInput()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0507) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::MediaInputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentMediaInput(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadMediaInputClusterRevision : public ModelCommand
{
public:
    ReadMediaInputClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadMediaInputClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0507) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::MediaInputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster MediaPlayback                                               | 0x0506 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * MediaFastForward                                                  |   0x07 |
| * MediaNext                                                         |   0x05 |
| * MediaPause                                                        |   0x01 |
| * MediaPlay                                                         |   0x00 |
| * MediaPrevious                                                     |   0x04 |
| * MediaRewind                                                       |   0x06 |
| * MediaSeek                                                         |   0x0A |
| * MediaSkipBackward                                                 |   0x09 |
| * MediaSkipForward                                                  |   0x08 |
| * MediaStartOver                                                    |   0x03 |
| * MediaStop                                                         |   0x02 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command MediaFastForward
 */
class MediaPlaybackMediaFastForward : public ModelCommand
{
public:
    MediaPlaybackMediaFastForward() : ModelCommand("media-fast-forward") { ModelCommand::AddArguments(); }
    ~MediaPlaybackMediaFastForward()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x07) on endpoint %" PRIu8, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MediaFastForward(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<MediaPlaybackClusterMediaFastForwardResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<MediaPlaybackClusterMediaFastForwardResponseCallback>(
            OnMediaPlaybackClusterMediaFastForwardResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command MediaNext
 */
class MediaPlaybackMediaNext : public ModelCommand
{
public:
    MediaPlaybackMediaNext() : ModelCommand("media-next") { ModelCommand::AddArguments(); }
    ~MediaPlaybackMediaNext()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x05) on endpoint %" PRIu8, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MediaNext(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<MediaPlaybackClusterMediaNextResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<MediaPlaybackClusterMediaNextResponseCallback>(OnMediaPlaybackClusterMediaNextResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command MediaPause
 */
class MediaPlaybackMediaPause : public ModelCommand
{
public:
    MediaPlaybackMediaPause() : ModelCommand("media-pause") { ModelCommand::AddArguments(); }
    ~MediaPlaybackMediaPause()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MediaPause(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<MediaPlaybackClusterMediaPauseResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<MediaPlaybackClusterMediaPauseResponseCallback>(OnMediaPlaybackClusterMediaPauseResponse,
                                                                                     this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command MediaPlay
 */
class MediaPlaybackMediaPlay : public ModelCommand
{
public:
    MediaPlaybackMediaPlay() : ModelCommand("media-play") { ModelCommand::AddArguments(); }
    ~MediaPlaybackMediaPlay()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MediaPlay(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<MediaPlaybackClusterMediaPlayResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<MediaPlaybackClusterMediaPlayResponseCallback>(OnMediaPlaybackClusterMediaPlayResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command MediaPrevious
 */
class MediaPlaybackMediaPrevious : public ModelCommand
{
public:
    MediaPlaybackMediaPrevious() : ModelCommand("media-previous") { ModelCommand::AddArguments(); }
    ~MediaPlaybackMediaPrevious()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x04) on endpoint %" PRIu8, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MediaPrevious(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<MediaPlaybackClusterMediaPreviousResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<MediaPlaybackClusterMediaPreviousResponseCallback>(OnMediaPlaybackClusterMediaPreviousResponse,
                                                                                        this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command MediaRewind
 */
class MediaPlaybackMediaRewind : public ModelCommand
{
public:
    MediaPlaybackMediaRewind() : ModelCommand("media-rewind") { ModelCommand::AddArguments(); }
    ~MediaPlaybackMediaRewind()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MediaRewind(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<MediaPlaybackClusterMediaRewindResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<MediaPlaybackClusterMediaRewindResponseCallback>(OnMediaPlaybackClusterMediaRewindResponse,
                                                                                      this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command MediaSeek
 */
class MediaPlaybackMediaSeek : public ModelCommand
{
public:
    MediaPlaybackMediaSeek() : ModelCommand("media-seek")
    {
        AddArgument("Position", 0, UINT64_MAX, &mPosition);
        ModelCommand::AddArguments();
    }
    ~MediaPlaybackMediaSeek()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x0A) on endpoint %" PRIu8, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MediaSeek(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mPosition);
    }

private:
    chip::Callback::Callback<MediaPlaybackClusterMediaSeekResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<MediaPlaybackClusterMediaSeekResponseCallback>(OnMediaPlaybackClusterMediaSeekResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint64_t mPosition;
};

/*
 * Command MediaSkipBackward
 */
class MediaPlaybackMediaSkipBackward : public ModelCommand
{
public:
    MediaPlaybackMediaSkipBackward() : ModelCommand("media-skip-backward")
    {
        AddArgument("DeltaPositionMilliseconds", 0, UINT64_MAX, &mDeltaPositionMilliseconds);
        ModelCommand::AddArguments();
    }
    ~MediaPlaybackMediaSkipBackward()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x09) on endpoint %" PRIu8, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MediaSkipBackward(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mDeltaPositionMilliseconds);
    }

private:
    chip::Callback::Callback<MediaPlaybackClusterMediaSkipBackwardResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<MediaPlaybackClusterMediaSkipBackwardResponseCallback>(
            OnMediaPlaybackClusterMediaSkipBackwardResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint64_t mDeltaPositionMilliseconds;
};

/*
 * Command MediaSkipForward
 */
class MediaPlaybackMediaSkipForward : public ModelCommand
{
public:
    MediaPlaybackMediaSkipForward() : ModelCommand("media-skip-forward")
    {
        AddArgument("DeltaPositionMilliseconds", 0, UINT64_MAX, &mDeltaPositionMilliseconds);
        ModelCommand::AddArguments();
    }
    ~MediaPlaybackMediaSkipForward()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x08) on endpoint %" PRIu8, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MediaSkipForward(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mDeltaPositionMilliseconds);
    }

private:
    chip::Callback::Callback<MediaPlaybackClusterMediaSkipForwardResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<MediaPlaybackClusterMediaSkipForwardResponseCallback>(
            OnMediaPlaybackClusterMediaSkipForwardResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint64_t mDeltaPositionMilliseconds;
};

/*
 * Command MediaStartOver
 */
class MediaPlaybackMediaStartOver : public ModelCommand
{
public:
    MediaPlaybackMediaStartOver() : ModelCommand("media-start-over") { ModelCommand::AddArguments(); }
    ~MediaPlaybackMediaStartOver()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x03) on endpoint %" PRIu8, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MediaStartOver(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<MediaPlaybackClusterMediaStartOverResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<MediaPlaybackClusterMediaStartOverResponseCallback>(
            OnMediaPlaybackClusterMediaStartOverResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command MediaStop
 */
class MediaPlaybackMediaStop : public ModelCommand
{
public:
    MediaPlaybackMediaStop() : ModelCommand("media-stop") { ModelCommand::AddArguments(); }
    ~MediaPlaybackMediaStop()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x02) on endpoint %" PRIu8, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MediaStop(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<MediaPlaybackClusterMediaStopResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<MediaPlaybackClusterMediaStopResponseCallback>(OnMediaPlaybackClusterMediaStopResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Discover Attributes
 */
class DiscoverMediaPlaybackAttributes : public ModelCommand
{
public:
    DiscoverMediaPlaybackAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverMediaPlaybackAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadMediaPlaybackClusterRevision : public ModelCommand
{
public:
    ReadMediaPlaybackClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadMediaPlaybackClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster NetworkCommissioning                                        | 0x0031 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * AddThreadNetwork                                                  |   0x06 |
| * AddWiFiNetwork                                                    |   0x02 |
| * DisableNetwork                                                    |   0x0E |
| * EnableNetwork                                                     |   0x0C |
| * GetLastNetworkCommissioningResult                                 |   0x10 |
| * RemoveNetwork                                                     |   0x0A |
| * ScanNetworks                                                      |   0x00 |
| * UpdateThreadNetwork                                               |   0x08 |
| * UpdateWiFiNetwork                                                 |   0x04 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command AddThreadNetwork
 */
class NetworkCommissioningAddThreadNetwork : public ModelCommand
{
public:
    NetworkCommissioningAddThreadNetwork() : ModelCommand("add-thread-network")
    {
        AddArgument("OperationalDataset", &mOperationalDataset);
        AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb);
        AddArgument("TimeoutMs", 0, UINT32_MAX, &mTimeoutMs);
        ModelCommand::AddArguments();
    }
    ~NetworkCommissioningAddThreadNetwork()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0031) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::NetworkCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.AddThreadNetwork(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mOperationalDataset, mBreadcrumb,
                                        mTimeoutMs);
    }

private:
    chip::Callback::Callback<NetworkCommissioningClusterAddThreadNetworkResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<NetworkCommissioningClusterAddThreadNetworkResponseCallback>(
            OnNetworkCommissioningClusterAddThreadNetworkResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::ByteSpan mOperationalDataset;
    uint64_t mBreadcrumb;
    uint32_t mTimeoutMs;
};

/*
 * Command AddWiFiNetwork
 */
class NetworkCommissioningAddWiFiNetwork : public ModelCommand
{
public:
    NetworkCommissioningAddWiFiNetwork() : ModelCommand("add-wi-fi-network")
    {
        AddArgument("Ssid", &mSsid);
        AddArgument("Credentials", &mCredentials);
        AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb);
        AddArgument("TimeoutMs", 0, UINT32_MAX, &mTimeoutMs);
        ModelCommand::AddArguments();
    }
    ~NetworkCommissioningAddWiFiNetwork()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0031) command (0x02) on endpoint %" PRIu8, endpointId);

        chip::Controller::NetworkCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.AddWiFiNetwork(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mSsid, mCredentials, mBreadcrumb,
                                      mTimeoutMs);
    }

private:
    chip::Callback::Callback<NetworkCommissioningClusterAddWiFiNetworkResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<NetworkCommissioningClusterAddWiFiNetworkResponseCallback>(
            OnNetworkCommissioningClusterAddWiFiNetworkResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::ByteSpan mSsid;
    chip::ByteSpan mCredentials;
    uint64_t mBreadcrumb;
    uint32_t mTimeoutMs;
};

/*
 * Command DisableNetwork
 */
class NetworkCommissioningDisableNetwork : public ModelCommand
{
public:
    NetworkCommissioningDisableNetwork() : ModelCommand("disable-network")
    {
        AddArgument("NetworkID", &mNetworkID);
        AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb);
        AddArgument("TimeoutMs", 0, UINT32_MAX, &mTimeoutMs);
        ModelCommand::AddArguments();
    }
    ~NetworkCommissioningDisableNetwork()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0031) command (0x0E) on endpoint %" PRIu8, endpointId);

        chip::Controller::NetworkCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DisableNetwork(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mNetworkID, mBreadcrumb,
                                      mTimeoutMs);
    }

private:
    chip::Callback::Callback<NetworkCommissioningClusterDisableNetworkResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<NetworkCommissioningClusterDisableNetworkResponseCallback>(
            OnNetworkCommissioningClusterDisableNetworkResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::ByteSpan mNetworkID;
    uint64_t mBreadcrumb;
    uint32_t mTimeoutMs;
};

/*
 * Command EnableNetwork
 */
class NetworkCommissioningEnableNetwork : public ModelCommand
{
public:
    NetworkCommissioningEnableNetwork() : ModelCommand("enable-network")
    {
        AddArgument("NetworkID", &mNetworkID);
        AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb);
        AddArgument("TimeoutMs", 0, UINT32_MAX, &mTimeoutMs);
        ModelCommand::AddArguments();
    }
    ~NetworkCommissioningEnableNetwork()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0031) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::NetworkCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.EnableNetwork(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mNetworkID, mBreadcrumb, mTimeoutMs);
    }

private:
    chip::Callback::Callback<NetworkCommissioningClusterEnableNetworkResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<NetworkCommissioningClusterEnableNetworkResponseCallback>(
            OnNetworkCommissioningClusterEnableNetworkResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::ByteSpan mNetworkID;
    uint64_t mBreadcrumb;
    uint32_t mTimeoutMs;
};

/*
 * Command GetLastNetworkCommissioningResult
 */
class NetworkCommissioningGetLastNetworkCommissioningResult : public ModelCommand
{
public:
    NetworkCommissioningGetLastNetworkCommissioningResult() : ModelCommand("get-last-network-commissioning-result")
    {
        AddArgument("TimeoutMs", 0, UINT32_MAX, &mTimeoutMs);
        ModelCommand::AddArguments();
    }
    ~NetworkCommissioningGetLastNetworkCommissioningResult()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0031) command (0x10) on endpoint %" PRIu8, endpointId);

        chip::Controller::NetworkCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetLastNetworkCommissioningResult(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mTimeoutMs);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint32_t mTimeoutMs;
};

/*
 * Command RemoveNetwork
 */
class NetworkCommissioningRemoveNetwork : public ModelCommand
{
public:
    NetworkCommissioningRemoveNetwork() : ModelCommand("remove-network")
    {
        AddArgument("NetworkID", &mNetworkID);
        AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb);
        AddArgument("TimeoutMs", 0, UINT32_MAX, &mTimeoutMs);
        ModelCommand::AddArguments();
    }
    ~NetworkCommissioningRemoveNetwork()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0031) command (0x0A) on endpoint %" PRIu8, endpointId);

        chip::Controller::NetworkCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.RemoveNetwork(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mNetworkID, mBreadcrumb, mTimeoutMs);
    }

private:
    chip::Callback::Callback<NetworkCommissioningClusterRemoveNetworkResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<NetworkCommissioningClusterRemoveNetworkResponseCallback>(
            OnNetworkCommissioningClusterRemoveNetworkResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::ByteSpan mNetworkID;
    uint64_t mBreadcrumb;
    uint32_t mTimeoutMs;
};

/*
 * Command ScanNetworks
 */
class NetworkCommissioningScanNetworks : public ModelCommand
{
public:
    NetworkCommissioningScanNetworks() : ModelCommand("scan-networks")
    {
        AddArgument("Ssid", &mSsid);
        AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb);
        AddArgument("TimeoutMs", 0, UINT32_MAX, &mTimeoutMs);
        ModelCommand::AddArguments();
    }
    ~NetworkCommissioningScanNetworks()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0031) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::NetworkCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ScanNetworks(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mSsid, mBreadcrumb, mTimeoutMs);
    }

private:
    chip::Callback::Callback<NetworkCommissioningClusterScanNetworksResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<NetworkCommissioningClusterScanNetworksResponseCallback>(
            OnNetworkCommissioningClusterScanNetworksResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::ByteSpan mSsid;
    uint64_t mBreadcrumb;
    uint32_t mTimeoutMs;
};

/*
 * Command UpdateThreadNetwork
 */
class NetworkCommissioningUpdateThreadNetwork : public ModelCommand
{
public:
    NetworkCommissioningUpdateThreadNetwork() : ModelCommand("update-thread-network")
    {
        AddArgument("OperationalDataset", &mOperationalDataset);
        AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb);
        AddArgument("TimeoutMs", 0, UINT32_MAX, &mTimeoutMs);
        ModelCommand::AddArguments();
    }
    ~NetworkCommissioningUpdateThreadNetwork()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0031) command (0x08) on endpoint %" PRIu8, endpointId);

        chip::Controller::NetworkCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.UpdateThreadNetwork(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mOperationalDataset,
                                           mBreadcrumb, mTimeoutMs);
    }

private:
    chip::Callback::Callback<NetworkCommissioningClusterUpdateThreadNetworkResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<NetworkCommissioningClusterUpdateThreadNetworkResponseCallback>(
            OnNetworkCommissioningClusterUpdateThreadNetworkResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::ByteSpan mOperationalDataset;
    uint64_t mBreadcrumb;
    uint32_t mTimeoutMs;
};

/*
 * Command UpdateWiFiNetwork
 */
class NetworkCommissioningUpdateWiFiNetwork : public ModelCommand
{
public:
    NetworkCommissioningUpdateWiFiNetwork() : ModelCommand("update-wi-fi-network")
    {
        AddArgument("Ssid", &mSsid);
        AddArgument("Credentials", &mCredentials);
        AddArgument("Breadcrumb", 0, UINT64_MAX, &mBreadcrumb);
        AddArgument("TimeoutMs", 0, UINT32_MAX, &mTimeoutMs);
        ModelCommand::AddArguments();
    }
    ~NetworkCommissioningUpdateWiFiNetwork()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0031) command (0x04) on endpoint %" PRIu8, endpointId);

        chip::Controller::NetworkCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.UpdateWiFiNetwork(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mSsid, mCredentials, mBreadcrumb,
                                         mTimeoutMs);
    }

private:
    chip::Callback::Callback<NetworkCommissioningClusterUpdateWiFiNetworkResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<NetworkCommissioningClusterUpdateWiFiNetworkResponseCallback>(
            OnNetworkCommissioningClusterUpdateWiFiNetworkResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::ByteSpan mSsid;
    chip::ByteSpan mCredentials;
    uint64_t mBreadcrumb;
    uint32_t mTimeoutMs;
};

/*
 * Discover Attributes
 */
class DiscoverNetworkCommissioningAttributes : public ModelCommand
{
public:
    DiscoverNetworkCommissioningAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverNetworkCommissioningAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::NetworkCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadNetworkCommissioningClusterRevision : public ModelCommand
{
public:
    ReadNetworkCommissioningClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadNetworkCommissioningClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0031) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::NetworkCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster OtaSoftwareUpdateProvider                                   | 0x0029 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * ApplyUpdateRequest                                                |   0x01 |
| * NotifyUpdateApplied                                               |   0x02 |
| * QueryImage                                                        |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command ApplyUpdateRequest
 */
class OtaSoftwareUpdateProviderApplyUpdateRequest : public ModelCommand
{
public:
    OtaSoftwareUpdateProviderApplyUpdateRequest() : ModelCommand("apply-update-request")
    {
        AddArgument("UpdateToken", &mUpdateToken);
        AddArgument("NewVersion", 0, UINT32_MAX, &mNewVersion);
        ModelCommand::AddArguments();
    }
    ~OtaSoftwareUpdateProviderApplyUpdateRequest()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0029) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::OtaSoftwareUpdateProviderCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ApplyUpdateRequest(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUpdateToken, mNewVersion);
    }

private:
    chip::Callback::Callback<OtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<OtaSoftwareUpdateProviderClusterApplyUpdateRequestResponseCallback>(
            OnOtaSoftwareUpdateProviderClusterApplyUpdateRequestResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::ByteSpan mUpdateToken;
    uint32_t mNewVersion;
};

/*
 * Command NotifyUpdateApplied
 */
class OtaSoftwareUpdateProviderNotifyUpdateApplied : public ModelCommand
{
public:
    OtaSoftwareUpdateProviderNotifyUpdateApplied() : ModelCommand("notify-update-applied")
    {
        AddArgument("UpdateToken", &mUpdateToken);
        AddArgument("CurrentVersion", 0, UINT32_MAX, &mCurrentVersion);
        ModelCommand::AddArguments();
    }
    ~OtaSoftwareUpdateProviderNotifyUpdateApplied()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0029) command (0x02) on endpoint %" PRIu8, endpointId);

        chip::Controller::OtaSoftwareUpdateProviderCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.NotifyUpdateApplied(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUpdateToken, mCurrentVersion);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::ByteSpan mUpdateToken;
    uint32_t mCurrentVersion;
};

/*
 * Command QueryImage
 */
class OtaSoftwareUpdateProviderQueryImage : public ModelCommand
{
public:
    OtaSoftwareUpdateProviderQueryImage() : ModelCommand("query-image")
    {
        AddArgument("VendorId", 0, UINT16_MAX, &mVendorId);
        AddArgument("ProductId", 0, UINT16_MAX, &mProductId);
        AddArgument("ImageType", 0, UINT16_MAX, &mImageType);
        AddArgument("HardwareVersion", 0, UINT16_MAX, &mHardwareVersion);
        AddArgument("CurrentVersion", 0, UINT32_MAX, &mCurrentVersion);
        AddArgument("ProtocolsSupported", 0, UINT8_MAX, &mProtocolsSupported);
        AddArgument("Location", &mLocation);
        AddArgument("RequestorCanConsent", 0, UINT8_MAX, &mRequestorCanConsent);
        AddArgument("MetadataForProvider", &mMetadataForProvider);
        ModelCommand::AddArguments();
    }
    ~OtaSoftwareUpdateProviderQueryImage()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0029) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::OtaSoftwareUpdateProviderCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.QueryImage(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mVendorId, mProductId, mImageType,
                                  mHardwareVersion, mCurrentVersion, mProtocolsSupported,
                                  chip::ByteSpan(chip::Uint8::from_char(mLocation), strlen(mLocation)), mRequestorCanConsent,
                                  mMetadataForProvider);
    }

private:
    chip::Callback::Callback<OtaSoftwareUpdateProviderClusterQueryImageResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<OtaSoftwareUpdateProviderClusterQueryImageResponseCallback>(
            OnOtaSoftwareUpdateProviderClusterQueryImageResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mVendorId;
    uint16_t mProductId;
    uint16_t mImageType;
    uint16_t mHardwareVersion;
    uint32_t mCurrentVersion;
    uint8_t mProtocolsSupported;
    char * mLocation;
    uint8_t mRequestorCanConsent;
    chip::ByteSpan mMetadataForProvider;
};

/*
 * Discover Attributes
 */
class DiscoverOtaSoftwareUpdateProviderAttributes : public ModelCommand
{
public:
    DiscoverOtaSoftwareUpdateProviderAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverOtaSoftwareUpdateProviderAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::OtaSoftwareUpdateProviderCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadOtaSoftwareUpdateProviderClusterRevision : public ModelCommand
{
public:
    ReadOtaSoftwareUpdateProviderClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadOtaSoftwareUpdateProviderClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0029) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::OtaSoftwareUpdateProviderCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster OccupancySensing                                            | 0x0406 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * Occupancy                                                         | 0x0000 |
| * OccupancySensorType                                               | 0x0001 |
| * OccupancySensorTypeBitmap                                         | 0x0002 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Discover Attributes
 */
class DiscoverOccupancySensingAttributes : public ModelCommand
{
public:
    DiscoverOccupancySensingAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverOccupancySensingAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::OccupancySensingCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Occupancy
 */
class ReadOccupancySensingOccupancy : public ModelCommand
{
public:
    ReadOccupancySensingOccupancy() : ModelCommand("read")
    {
        AddArgument("attr-name", "occupancy");
        ModelCommand::AddArguments();
    }

    ~ReadOccupancySensingOccupancy()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0406) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::OccupancySensingCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeOccupancy(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportOccupancySensingOccupancy : public ModelCommand
{
public:
    ReportOccupancySensingOccupancy() : ModelCommand("report")
    {
        AddArgument("attr-name", "occupancy");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        ModelCommand::AddArguments();
    }

    ~ReportOccupancySensingOccupancy()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0406) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::OccupancySensingCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeOccupancy(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeOccupancy(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                   mMaxInterval);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int8uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
};

/*
 * Attribute OccupancySensorType
 */
class ReadOccupancySensingOccupancySensorType : public ModelCommand
{
public:
    ReadOccupancySensingOccupancySensorType() : ModelCommand("read")
    {
        AddArgument("attr-name", "occupancy-sensor-type");
        ModelCommand::AddArguments();
    }

    ~ReadOccupancySensingOccupancySensorType()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0406) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::OccupancySensingCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeOccupancySensorType(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute OccupancySensorTypeBitmap
 */
class ReadOccupancySensingOccupancySensorTypeBitmap : public ModelCommand
{
public:
    ReadOccupancySensingOccupancySensorTypeBitmap() : ModelCommand("read")
    {
        AddArgument("attr-name", "occupancy-sensor-type-bitmap");
        ModelCommand::AddArguments();
    }

    ~ReadOccupancySensingOccupancySensorTypeBitmap()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0406) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::OccupancySensingCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeOccupancySensorTypeBitmap(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadOccupancySensingClusterRevision : public ModelCommand
{
public:
    ReadOccupancySensingClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadOccupancySensingClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0406) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::OccupancySensingCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster OnOff                                                       | 0x0006 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * Off                                                               |   0x00 |
| * OffWithEffect                                                     |   0x40 |
| * On                                                                |   0x01 |
| * OnWithRecallGlobalScene                                           |   0x41 |
| * OnWithTimedOff                                                    |   0x42 |
| * Toggle                                                            |   0x02 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * OnOff                                                             | 0x0000 |
| * GlobalSceneControl                                                | 0x4000 |
| * OnTime                                                            | 0x4001 |
| * OffWaitTime                                                       | 0x4002 |
| * StartUpOnOff                                                      | 0x4003 |
| * FeatureMap                                                        | 0xFFFC |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command Off
 */
class OnOffOff : public ModelCommand
{
public:
    OnOffOff() : ModelCommand("off") { ModelCommand::AddArguments(); }
    ~OnOffOff()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::OnOffCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.Off(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command OffWithEffect
 */
class OnOffOffWithEffect : public ModelCommand
{
public:
    OnOffOffWithEffect() : ModelCommand("off-with-effect")
    {
        AddArgument("EffectId", 0, UINT8_MAX, &mEffectId);
        AddArgument("EffectVariant", 0, UINT8_MAX, &mEffectVariant);
        ModelCommand::AddArguments();
    }
    ~OnOffOffWithEffect()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x40) on endpoint %" PRIu8, endpointId);

        chip::Controller::OnOffCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.OffWithEffect(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mEffectId, mEffectVariant);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mEffectId;
    uint8_t mEffectVariant;
};

/*
 * Command On
 */
class OnOffOn : public ModelCommand
{
public:
    OnOffOn() : ModelCommand("on") { ModelCommand::AddArguments(); }
    ~OnOffOn()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::OnOffCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.On(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command OnWithRecallGlobalScene
 */
class OnOffOnWithRecallGlobalScene : public ModelCommand
{
public:
    OnOffOnWithRecallGlobalScene() : ModelCommand("on-with-recall-global-scene") { ModelCommand::AddArguments(); }
    ~OnOffOnWithRecallGlobalScene()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x41) on endpoint %" PRIu8, endpointId);

        chip::Controller::OnOffCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.OnWithRecallGlobalScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command OnWithTimedOff
 */
class OnOffOnWithTimedOff : public ModelCommand
{
public:
    OnOffOnWithTimedOff() : ModelCommand("on-with-timed-off")
    {
        AddArgument("OnOffControl", 0, UINT8_MAX, &mOnOffControl);
        AddArgument("OnTime", 0, UINT16_MAX, &mOnTime);
        AddArgument("OffWaitTime", 0, UINT16_MAX, &mOffWaitTime);
        ModelCommand::AddArguments();
    }
    ~OnOffOnWithTimedOff()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x42) on endpoint %" PRIu8, endpointId);

        chip::Controller::OnOffCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.OnWithTimedOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mOnOffControl, mOnTime,
                                      mOffWaitTime);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mOnOffControl;
    uint16_t mOnTime;
    uint16_t mOffWaitTime;
};

/*
 * Command Toggle
 */
class OnOffToggle : public ModelCommand
{
public:
    OnOffToggle() : ModelCommand("toggle") { ModelCommand::AddArguments(); }
    ~OnOffToggle()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x02) on endpoint %" PRIu8, endpointId);

        chip::Controller::OnOffCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.Toggle(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Discover Attributes
 */
class DiscoverOnOffAttributes : public ModelCommand
{
public:
    DiscoverOnOffAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverOnOffAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::OnOffCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute OnOff
 */
class ReadOnOffOnOff : public ModelCommand
{
public:
    ReadOnOffOnOff() : ModelCommand("read")
    {
        AddArgument("attr-name", "on-off");
        ModelCommand::AddArguments();
    }

    ~ReadOnOffOnOff()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::OnOffCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<BooleanAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportOnOffOnOff : public ModelCommand
{
public:
    ReportOnOffOnOff() : ModelCommand("report")
    {
        AddArgument("attr-name", "on-off");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        ModelCommand::AddArguments();
    }

    ~ReportOnOffOnOff()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::OnOffCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeOnOff(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                               mMaxInterval);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<BooleanAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
};

/*
 * Attribute GlobalSceneControl
 */
class ReadOnOffGlobalSceneControl : public ModelCommand
{
public:
    ReadOnOffGlobalSceneControl() : ModelCommand("read")
    {
        AddArgument("attr-name", "global-scene-control");
        ModelCommand::AddArguments();
    }

    ~ReadOnOffGlobalSceneControl()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::OnOffCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeGlobalSceneControl(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<BooleanAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute OnTime
 */
class ReadOnOffOnTime : public ModelCommand
{
public:
    ReadOnOffOnTime() : ModelCommand("read")
    {
        AddArgument("attr-name", "on-time");
        ModelCommand::AddArguments();
    }

    ~ReadOnOffOnTime()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::OnOffCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeOnTime(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteOnOffOnTime : public ModelCommand
{
public:
    WriteOnOffOnTime() : ModelCommand("write")
    {
        AddArgument("attr-name", "on-time");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteOnOffOnTime()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::OnOffCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeOnTime(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute OffWaitTime
 */
class ReadOnOffOffWaitTime : public ModelCommand
{
public:
    ReadOnOffOffWaitTime() : ModelCommand("read")
    {
        AddArgument("attr-name", "off-wait-time");
        ModelCommand::AddArguments();
    }

    ~ReadOnOffOffWaitTime()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::OnOffCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeOffWaitTime(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteOnOffOffWaitTime : public ModelCommand
{
public:
    WriteOnOffOffWaitTime() : ModelCommand("write")
    {
        AddArgument("attr-name", "off-wait-time");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteOnOffOffWaitTime()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::OnOffCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeOffWaitTime(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute StartUpOnOff
 */
class ReadOnOffStartUpOnOff : public ModelCommand
{
public:
    ReadOnOffStartUpOnOff() : ModelCommand("read")
    {
        AddArgument("attr-name", "start-up-on-off");
        ModelCommand::AddArguments();
    }

    ~ReadOnOffStartUpOnOff()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::OnOffCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeStartUpOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteOnOffStartUpOnOff : public ModelCommand
{
public:
    WriteOnOffStartUpOnOff() : ModelCommand("write")
    {
        AddArgument("attr-name", "start-up-on-off");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteOnOffStartUpOnOff()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::OnOffCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeStartUpOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute FeatureMap
 */
class ReadOnOffFeatureMap : public ModelCommand
{
public:
    ReadOnOffFeatureMap() : ModelCommand("read")
    {
        AddArgument("attr-name", "feature-map");
        ModelCommand::AddArguments();
    }

    ~ReadOnOffFeatureMap()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::OnOffCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeFeatureMap(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadOnOffClusterRevision : public ModelCommand
{
public:
    ReadOnOffClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadOnOffClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::OnOffCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster OperationalCredentials                                      | 0x003E |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * AddOpCert                                                         |   0x06 |
| * AddTrustedRootCertificate                                         |   0xA1 |
| * OpCSRRequest                                                      |   0x04 |
| * RemoveAllFabrics                                                  |   0x0B |
| * RemoveFabric                                                      |   0x0A |
| * RemoveTrustedRootCertificate                                      |   0xA2 |
| * SetFabric                                                         |   0x00 |
| * UpdateFabricLabel                                                 |   0x09 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * FabricsList                                                       | 0x0001 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command AddOpCert
 */
class OperationalCredentialsAddOpCert : public ModelCommand
{
public:
    OperationalCredentialsAddOpCert() : ModelCommand("add-op-cert")
    {
        AddArgument("NOCArray", &mNOCArray);
        AddArgument("IPKValue", &mIPKValue);
        AddArgument("CaseAdminNode", 0, UINT64_MAX, &mCaseAdminNode);
        AddArgument("AdminVendorId", 0, UINT16_MAX, &mAdminVendorId);
        ModelCommand::AddArguments();
    }
    ~OperationalCredentialsAddOpCert()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::OperationalCredentialsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.AddOpCert(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mNOCArray, mIPKValue, mCaseAdminNode,
                                 mAdminVendorId);
    }

private:
    chip::Callback::Callback<OperationalCredentialsClusterOpCertResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<OperationalCredentialsClusterOpCertResponseCallback>(
            OnOperationalCredentialsClusterOpCertResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::ByteSpan mNOCArray;
    chip::ByteSpan mIPKValue;
    chip::NodeId mCaseAdminNode;
    uint16_t mAdminVendorId;
};

/*
 * Command AddTrustedRootCertificate
 */
class OperationalCredentialsAddTrustedRootCertificate : public ModelCommand
{
public:
    OperationalCredentialsAddTrustedRootCertificate() : ModelCommand("add-trusted-root-certificate")
    {
        AddArgument("RootCertificate", &mRootCertificate);
        ModelCommand::AddArguments();
    }
    ~OperationalCredentialsAddTrustedRootCertificate()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0xA1) on endpoint %" PRIu8, endpointId);

        chip::Controller::OperationalCredentialsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.AddTrustedRootCertificate(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mRootCertificate);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::ByteSpan mRootCertificate;
};

/*
 * Command OpCSRRequest
 */
class OperationalCredentialsOpCSRRequest : public ModelCommand
{
public:
    OperationalCredentialsOpCSRRequest() : ModelCommand("op-csrrequest")
    {
        AddArgument("CSRNonce", &mCSRNonce);
        ModelCommand::AddArguments();
    }
    ~OperationalCredentialsOpCSRRequest()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x04) on endpoint %" PRIu8, endpointId);

        chip::Controller::OperationalCredentialsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.OpCSRRequest(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mCSRNonce);
    }

private:
    chip::Callback::Callback<OperationalCredentialsClusterOpCSRResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<OperationalCredentialsClusterOpCSRResponseCallback>(
            OnOperationalCredentialsClusterOpCSRResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::ByteSpan mCSRNonce;
};

/*
 * Command RemoveAllFabrics
 */
class OperationalCredentialsRemoveAllFabrics : public ModelCommand
{
public:
    OperationalCredentialsRemoveAllFabrics() : ModelCommand("remove-all-fabrics") { ModelCommand::AddArguments(); }
    ~OperationalCredentialsRemoveAllFabrics()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x0B) on endpoint %" PRIu8, endpointId);

        chip::Controller::OperationalCredentialsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.RemoveAllFabrics(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command RemoveFabric
 */
class OperationalCredentialsRemoveFabric : public ModelCommand
{
public:
    OperationalCredentialsRemoveFabric() : ModelCommand("remove-fabric")
    {
        AddArgument("FabricId", 0, UINT64_MAX, &mFabricId);
        AddArgument("NodeId", 0, UINT64_MAX, &mNodeId);
        AddArgument("VendorId", 0, UINT16_MAX, &mVendorId);
        ModelCommand::AddArguments();
    }
    ~OperationalCredentialsRemoveFabric()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x0A) on endpoint %" PRIu8, endpointId);

        chip::Controller::OperationalCredentialsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.RemoveFabric(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mFabricId, mNodeId, mVendorId);
    }

private:
    chip::Callback::Callback<OperationalCredentialsClusterOpCertResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<OperationalCredentialsClusterOpCertResponseCallback>(
            OnOperationalCredentialsClusterOpCertResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::FabricId mFabricId;
    chip::NodeId mNodeId;
    uint16_t mVendorId;
};

/*
 * Command RemoveTrustedRootCertificate
 */
class OperationalCredentialsRemoveTrustedRootCertificate : public ModelCommand
{
public:
    OperationalCredentialsRemoveTrustedRootCertificate() : ModelCommand("remove-trusted-root-certificate")
    {
        AddArgument("TrustedRootIdentifier", &mTrustedRootIdentifier);
        ModelCommand::AddArguments();
    }
    ~OperationalCredentialsRemoveTrustedRootCertificate()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0xA2) on endpoint %" PRIu8, endpointId);

        chip::Controller::OperationalCredentialsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.RemoveTrustedRootCertificate(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                                    mTrustedRootIdentifier);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::ByteSpan mTrustedRootIdentifier;
};

/*
 * Command SetFabric
 */
class OperationalCredentialsSetFabric : public ModelCommand
{
public:
    OperationalCredentialsSetFabric() : ModelCommand("set-fabric")
    {
        AddArgument("VendorId", 0, UINT16_MAX, &mVendorId);
        ModelCommand::AddArguments();
    }
    ~OperationalCredentialsSetFabric()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::OperationalCredentialsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SetFabric(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mVendorId);
    }

private:
    chip::Callback::Callback<OperationalCredentialsClusterSetFabricResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<OperationalCredentialsClusterSetFabricResponseCallback>(
            OnOperationalCredentialsClusterSetFabricResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mVendorId;
};

/*
 * Command UpdateFabricLabel
 */
class OperationalCredentialsUpdateFabricLabel : public ModelCommand
{
public:
    OperationalCredentialsUpdateFabricLabel() : ModelCommand("update-fabric-label")
    {
        AddArgument("Label", &mLabel);
        ModelCommand::AddArguments();
    }
    ~OperationalCredentialsUpdateFabricLabel()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x09) on endpoint %" PRIu8, endpointId);

        chip::Controller::OperationalCredentialsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.UpdateFabricLabel(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                         chip::ByteSpan(chip::Uint8::from_char(mLabel), strlen(mLabel)));
    }

private:
    chip::Callback::Callback<OperationalCredentialsClusterOpCertResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<OperationalCredentialsClusterOpCertResponseCallback>(
            OnOperationalCredentialsClusterOpCertResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mLabel;
};

/*
 * Discover Attributes
 */
class DiscoverOperationalCredentialsAttributes : public ModelCommand
{
public:
    DiscoverOperationalCredentialsAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverOperationalCredentialsAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::OperationalCredentialsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute FabricsList
 */
class ReadOperationalCredentialsFabricsList : public ModelCommand
{
public:
    ReadOperationalCredentialsFabricsList() : ModelCommand("read")
    {
        AddArgument("attr-name", "fabrics-list");
        ModelCommand::AddArguments();
    }

    ~ReadOperationalCredentialsFabricsList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::OperationalCredentialsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeFabricsList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<OperationalCredentialsFabricsListListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<OperationalCredentialsFabricsListListAttributeCallback>(
            OnOperationalCredentialsFabricsListListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadOperationalCredentialsClusterRevision : public ModelCommand
{
public:
    ReadOperationalCredentialsClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadOperationalCredentialsClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::OperationalCredentialsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster PressureMeasurement                                         | 0x0403 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * MeasuredValue                                                     | 0x0000 |
| * MinMeasuredValue                                                  | 0x0001 |
| * MaxMeasuredValue                                                  | 0x0002 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Discover Attributes
 */
class DiscoverPressureMeasurementAttributes : public ModelCommand
{
public:
    DiscoverPressureMeasurementAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverPressureMeasurementAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::PressureMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute MeasuredValue
 */
class ReadPressureMeasurementMeasuredValue : public ModelCommand
{
public:
    ReadPressureMeasurementMeasuredValue() : ModelCommand("read")
    {
        AddArgument("attr-name", "measured-value");
        ModelCommand::AddArguments();
    }

    ~ReadPressureMeasurementMeasuredValue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0403) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::PressureMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportPressureMeasurementMeasuredValue : public ModelCommand
{
public:
    ReportPressureMeasurementMeasuredValue() : ModelCommand("report")
    {
        AddArgument("attr-name", "measured-value");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", INT16_MIN, INT16_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportPressureMeasurementMeasuredValue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0403) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::PressureMeasurementCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeMeasuredValue(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                       mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int16sAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    int16_t mChange;
};

/*
 * Attribute MinMeasuredValue
 */
class ReadPressureMeasurementMinMeasuredValue : public ModelCommand
{
public:
    ReadPressureMeasurementMinMeasuredValue() : ModelCommand("read")
    {
        AddArgument("attr-name", "min-measured-value");
        ModelCommand::AddArguments();
    }

    ~ReadPressureMeasurementMinMeasuredValue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0403) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::PressureMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMinMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute MaxMeasuredValue
 */
class ReadPressureMeasurementMaxMeasuredValue : public ModelCommand
{
public:
    ReadPressureMeasurementMaxMeasuredValue() : ModelCommand("read")
    {
        AddArgument("attr-name", "max-measured-value");
        ModelCommand::AddArguments();
    }

    ~ReadPressureMeasurementMaxMeasuredValue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0403) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::PressureMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMaxMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadPressureMeasurementClusterRevision : public ModelCommand
{
public:
    ReadPressureMeasurementClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadPressureMeasurementClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0403) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::PressureMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster PumpConfigurationAndControl                                 | 0x0200 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * MaxPressure                                                       | 0x0000 |
| * MaxSpeed                                                          | 0x0001 |
| * MaxFlow                                                           | 0x0002 |
| * EffectiveOperationMode                                            | 0x0011 |
| * EffectiveControlMode                                              | 0x0012 |
| * Capacity                                                          | 0x0013 |
| * OperationMode                                                     | 0x0020 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Discover Attributes
 */
class DiscoverPumpConfigurationAndControlAttributes : public ModelCommand
{
public:
    DiscoverPumpConfigurationAndControlAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverPumpConfigurationAndControlAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::PumpConfigurationAndControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute MaxPressure
 */
class ReadPumpConfigurationAndControlMaxPressure : public ModelCommand
{
public:
    ReadPumpConfigurationAndControlMaxPressure() : ModelCommand("read")
    {
        AddArgument("attr-name", "max-pressure");
        ModelCommand::AddArguments();
    }

    ~ReadPumpConfigurationAndControlMaxPressure()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0200) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::PumpConfigurationAndControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMaxPressure(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute MaxSpeed
 */
class ReadPumpConfigurationAndControlMaxSpeed : public ModelCommand
{
public:
    ReadPumpConfigurationAndControlMaxSpeed() : ModelCommand("read")
    {
        AddArgument("attr-name", "max-speed");
        ModelCommand::AddArguments();
    }

    ~ReadPumpConfigurationAndControlMaxSpeed()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0200) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::PumpConfigurationAndControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMaxSpeed(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute MaxFlow
 */
class ReadPumpConfigurationAndControlMaxFlow : public ModelCommand
{
public:
    ReadPumpConfigurationAndControlMaxFlow() : ModelCommand("read")
    {
        AddArgument("attr-name", "max-flow");
        ModelCommand::AddArguments();
    }

    ~ReadPumpConfigurationAndControlMaxFlow()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0200) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::PumpConfigurationAndControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMaxFlow(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute EffectiveOperationMode
 */
class ReadPumpConfigurationAndControlEffectiveOperationMode : public ModelCommand
{
public:
    ReadPumpConfigurationAndControlEffectiveOperationMode() : ModelCommand("read")
    {
        AddArgument("attr-name", "effective-operation-mode");
        ModelCommand::AddArguments();
    }

    ~ReadPumpConfigurationAndControlEffectiveOperationMode()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0200) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::PumpConfigurationAndControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeEffectiveOperationMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute EffectiveControlMode
 */
class ReadPumpConfigurationAndControlEffectiveControlMode : public ModelCommand
{
public:
    ReadPumpConfigurationAndControlEffectiveControlMode() : ModelCommand("read")
    {
        AddArgument("attr-name", "effective-control-mode");
        ModelCommand::AddArguments();
    }

    ~ReadPumpConfigurationAndControlEffectiveControlMode()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0200) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::PumpConfigurationAndControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeEffectiveControlMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Capacity
 */
class ReadPumpConfigurationAndControlCapacity : public ModelCommand
{
public:
    ReadPumpConfigurationAndControlCapacity() : ModelCommand("read")
    {
        AddArgument("attr-name", "capacity");
        ModelCommand::AddArguments();
    }

    ~ReadPumpConfigurationAndControlCapacity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0200) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::PumpConfigurationAndControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCapacity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportPumpConfigurationAndControlCapacity : public ModelCommand
{
public:
    ReportPumpConfigurationAndControlCapacity() : ModelCommand("report")
    {
        AddArgument("attr-name", "capacity");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", INT16_MIN, INT16_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportPumpConfigurationAndControlCapacity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0200) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::PumpConfigurationAndControlCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeCapacity(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeCapacity(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                  mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int16sAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    int16_t mChange;
};

/*
 * Attribute OperationMode
 */
class ReadPumpConfigurationAndControlOperationMode : public ModelCommand
{
public:
    ReadPumpConfigurationAndControlOperationMode() : ModelCommand("read")
    {
        AddArgument("attr-name", "operation-mode");
        ModelCommand::AddArguments();
    }

    ~ReadPumpConfigurationAndControlOperationMode()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0200) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::PumpConfigurationAndControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeOperationMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WritePumpConfigurationAndControlOperationMode : public ModelCommand
{
public:
    WritePumpConfigurationAndControlOperationMode() : ModelCommand("write")
    {
        AddArgument("attr-name", "operation-mode");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WritePumpConfigurationAndControlOperationMode()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0200) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::PumpConfigurationAndControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeOperationMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute ClusterRevision
 */
class ReadPumpConfigurationAndControlClusterRevision : public ModelCommand
{
public:
    ReadPumpConfigurationAndControlClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadPumpConfigurationAndControlClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0200) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::PumpConfigurationAndControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster RelativeHumidityMeasurement                                 | 0x0405 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * MeasuredValue                                                     | 0x0000 |
| * MinMeasuredValue                                                  | 0x0001 |
| * MaxMeasuredValue                                                  | 0x0002 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Discover Attributes
 */
class DiscoverRelativeHumidityMeasurementAttributes : public ModelCommand
{
public:
    DiscoverRelativeHumidityMeasurementAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverRelativeHumidityMeasurementAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::RelativeHumidityMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute MeasuredValue
 */
class ReadRelativeHumidityMeasurementMeasuredValue : public ModelCommand
{
public:
    ReadRelativeHumidityMeasurementMeasuredValue() : ModelCommand("read")
    {
        AddArgument("attr-name", "measured-value");
        ModelCommand::AddArguments();
    }

    ~ReadRelativeHumidityMeasurementMeasuredValue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0405) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::RelativeHumidityMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportRelativeHumidityMeasurementMeasuredValue : public ModelCommand
{
public:
    ReportRelativeHumidityMeasurementMeasuredValue() : ModelCommand("report")
    {
        AddArgument("attr-name", "measured-value");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", 0, UINT16_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportRelativeHumidityMeasurementMeasuredValue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0405) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::RelativeHumidityMeasurementCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeMeasuredValue(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                       mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int16uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    uint16_t mChange;
};

/*
 * Attribute MinMeasuredValue
 */
class ReadRelativeHumidityMeasurementMinMeasuredValue : public ModelCommand
{
public:
    ReadRelativeHumidityMeasurementMinMeasuredValue() : ModelCommand("read")
    {
        AddArgument("attr-name", "min-measured-value");
        ModelCommand::AddArguments();
    }

    ~ReadRelativeHumidityMeasurementMinMeasuredValue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0405) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::RelativeHumidityMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMinMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute MaxMeasuredValue
 */
class ReadRelativeHumidityMeasurementMaxMeasuredValue : public ModelCommand
{
public:
    ReadRelativeHumidityMeasurementMaxMeasuredValue() : ModelCommand("read")
    {
        AddArgument("attr-name", "max-measured-value");
        ModelCommand::AddArguments();
    }

    ~ReadRelativeHumidityMeasurementMaxMeasuredValue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0405) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::RelativeHumidityMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMaxMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadRelativeHumidityMeasurementClusterRevision : public ModelCommand
{
public:
    ReadRelativeHumidityMeasurementClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadRelativeHumidityMeasurementClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0405) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::RelativeHumidityMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster Scenes                                                      | 0x0005 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * AddScene                                                          |   0x00 |
| * GetSceneMembership                                                |   0x06 |
| * RecallScene                                                       |   0x05 |
| * RemoveAllScenes                                                   |   0x03 |
| * RemoveScene                                                       |   0x02 |
| * StoreScene                                                        |   0x04 |
| * ViewScene                                                         |   0x01 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * SceneCount                                                        | 0x0000 |
| * CurrentScene                                                      | 0x0001 |
| * CurrentGroup                                                      | 0x0002 |
| * SceneValid                                                        | 0x0003 |
| * NameSupport                                                       | 0x0004 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command AddScene
 */
class ScenesAddScene : public ModelCommand
{
public:
    ScenesAddScene() : ModelCommand("add-scene")
    {
        AddArgument("GroupId", 0, UINT16_MAX, &mGroupId);
        AddArgument("SceneId", 0, UINT8_MAX, &mSceneId);
        AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime);
        AddArgument("SceneName", &mSceneName);
        AddArgument("ClusterId", 0, UINT32_MAX, &mClusterId);
        AddArgument("Length", 0, UINT8_MAX, &mLength);
        AddArgument("Value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }
    ~ScenesAddScene()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.AddScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mSceneId, mTransitionTime,
                                chip::ByteSpan(chip::Uint8::from_char(mSceneName), strlen(mSceneName)), mClusterId, mLength,
                                mValue);
    }

private:
    chip::Callback::Callback<ScenesClusterAddSceneResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<ScenesClusterAddSceneResponseCallback>(OnScenesClusterAddSceneResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mGroupId;
    uint8_t mSceneId;
    uint16_t mTransitionTime;
    char * mSceneName;
    chip::ClusterId mClusterId;
    uint8_t mLength;
    uint8_t mValue;
};

/*
 * Command GetSceneMembership
 */
class ScenesGetSceneMembership : public ModelCommand
{
public:
    ScenesGetSceneMembership() : ModelCommand("get-scene-membership")
    {
        AddArgument("GroupId", 0, UINT16_MAX, &mGroupId);
        ModelCommand::AddArguments();
    }
    ~ScenesGetSceneMembership()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetSceneMembership(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId);
    }

private:
    chip::Callback::Callback<ScenesClusterGetSceneMembershipResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<ScenesClusterGetSceneMembershipResponseCallback>(OnScenesClusterGetSceneMembershipResponse,
                                                                                      this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mGroupId;
};

/*
 * Command RecallScene
 */
class ScenesRecallScene : public ModelCommand
{
public:
    ScenesRecallScene() : ModelCommand("recall-scene")
    {
        AddArgument("GroupId", 0, UINT16_MAX, &mGroupId);
        AddArgument("SceneId", 0, UINT8_MAX, &mSceneId);
        AddArgument("TransitionTime", 0, UINT16_MAX, &mTransitionTime);
        ModelCommand::AddArguments();
    }
    ~ScenesRecallScene()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x05) on endpoint %" PRIu8, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.RecallScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mSceneId, mTransitionTime);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mGroupId;
    uint8_t mSceneId;
    uint16_t mTransitionTime;
};

/*
 * Command RemoveAllScenes
 */
class ScenesRemoveAllScenes : public ModelCommand
{
public:
    ScenesRemoveAllScenes() : ModelCommand("remove-all-scenes")
    {
        AddArgument("GroupId", 0, UINT16_MAX, &mGroupId);
        ModelCommand::AddArguments();
    }
    ~ScenesRemoveAllScenes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x03) on endpoint %" PRIu8, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.RemoveAllScenes(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId);
    }

private:
    chip::Callback::Callback<ScenesClusterRemoveAllScenesResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<ScenesClusterRemoveAllScenesResponseCallback>(OnScenesClusterRemoveAllScenesResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mGroupId;
};

/*
 * Command RemoveScene
 */
class ScenesRemoveScene : public ModelCommand
{
public:
    ScenesRemoveScene() : ModelCommand("remove-scene")
    {
        AddArgument("GroupId", 0, UINT16_MAX, &mGroupId);
        AddArgument("SceneId", 0, UINT8_MAX, &mSceneId);
        ModelCommand::AddArguments();
    }
    ~ScenesRemoveScene()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x02) on endpoint %" PRIu8, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.RemoveScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mSceneId);
    }

private:
    chip::Callback::Callback<ScenesClusterRemoveSceneResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<ScenesClusterRemoveSceneResponseCallback>(OnScenesClusterRemoveSceneResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mGroupId;
    uint8_t mSceneId;
};

/*
 * Command StoreScene
 */
class ScenesStoreScene : public ModelCommand
{
public:
    ScenesStoreScene() : ModelCommand("store-scene")
    {
        AddArgument("GroupId", 0, UINT16_MAX, &mGroupId);
        AddArgument("SceneId", 0, UINT8_MAX, &mSceneId);
        ModelCommand::AddArguments();
    }
    ~ScenesStoreScene()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x04) on endpoint %" PRIu8, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.StoreScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mSceneId);
    }

private:
    chip::Callback::Callback<ScenesClusterStoreSceneResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<ScenesClusterStoreSceneResponseCallback>(OnScenesClusterStoreSceneResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mGroupId;
    uint8_t mSceneId;
};

/*
 * Command ViewScene
 */
class ScenesViewScene : public ModelCommand
{
public:
    ScenesViewScene() : ModelCommand("view-scene")
    {
        AddArgument("GroupId", 0, UINT16_MAX, &mGroupId);
        AddArgument("SceneId", 0, UINT8_MAX, &mSceneId);
        ModelCommand::AddArguments();
    }
    ~ScenesViewScene()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ViewScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mSceneId);
    }

private:
    chip::Callback::Callback<ScenesClusterViewSceneResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<ScenesClusterViewSceneResponseCallback>(OnScenesClusterViewSceneResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mGroupId;
    uint8_t mSceneId;
};

/*
 * Discover Attributes
 */
class DiscoverScenesAttributes : public ModelCommand
{
public:
    DiscoverScenesAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverScenesAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute SceneCount
 */
class ReadScenesSceneCount : public ModelCommand
{
public:
    ReadScenesSceneCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "scene-count");
        ModelCommand::AddArguments();
    }

    ~ReadScenesSceneCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeSceneCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CurrentScene
 */
class ReadScenesCurrentScene : public ModelCommand
{
public:
    ReadScenesCurrentScene() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-scene");
        ModelCommand::AddArguments();
    }

    ~ReadScenesCurrentScene()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CurrentGroup
 */
class ReadScenesCurrentGroup : public ModelCommand
{
public:
    ReadScenesCurrentGroup() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-group");
        ModelCommand::AddArguments();
    }

    ~ReadScenesCurrentGroup()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentGroup(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute SceneValid
 */
class ReadScenesSceneValid : public ModelCommand
{
public:
    ReadScenesSceneValid() : ModelCommand("read")
    {
        AddArgument("attr-name", "scene-valid");
        ModelCommand::AddArguments();
    }

    ~ReadScenesSceneValid()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeSceneValid(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<BooleanAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute NameSupport
 */
class ReadScenesNameSupport : public ModelCommand
{
public:
    ReadScenesNameSupport() : ModelCommand("read")
    {
        AddArgument("attr-name", "name-support");
        ModelCommand::AddArguments();
    }

    ~ReadScenesNameSupport()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeNameSupport(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadScenesClusterRevision : public ModelCommand
{
public:
    ReadScenesClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadScenesClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster SoftwareDiagnostics                                         | 0x0034 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * ResetWatermarks                                                   |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * CurrentHeapHighWatermark                                          | 0x0003 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command ResetWatermarks
 */
class SoftwareDiagnosticsResetWatermarks : public ModelCommand
{
public:
    SoftwareDiagnosticsResetWatermarks() : ModelCommand("reset-watermarks") { ModelCommand::AddArguments(); }
    ~SoftwareDiagnosticsResetWatermarks()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0034) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::SoftwareDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ResetWatermarks(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Discover Attributes
 */
class DiscoverSoftwareDiagnosticsAttributes : public ModelCommand
{
public:
    DiscoverSoftwareDiagnosticsAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverSoftwareDiagnosticsAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::SoftwareDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CurrentHeapHighWatermark
 */
class ReadSoftwareDiagnosticsCurrentHeapHighWatermark : public ModelCommand
{
public:
    ReadSoftwareDiagnosticsCurrentHeapHighWatermark() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-heap-high-watermark");
        ModelCommand::AddArguments();
    }

    ~ReadSoftwareDiagnosticsCurrentHeapHighWatermark()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0034) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::SoftwareDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentHeapHighWatermark(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int64uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int64uAttributeCallback>(OnInt64uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadSoftwareDiagnosticsClusterRevision : public ModelCommand
{
public:
    ReadSoftwareDiagnosticsClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadSoftwareDiagnosticsClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0034) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::SoftwareDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster Switch                                                      | 0x003B |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * NumberOfPositions                                                 | 0x0000 |
| * CurrentPosition                                                   | 0x0001 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Discover Attributes
 */
class DiscoverSwitchAttributes : public ModelCommand
{
public:
    DiscoverSwitchAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverSwitchAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::SwitchCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute NumberOfPositions
 */
class ReadSwitchNumberOfPositions : public ModelCommand
{
public:
    ReadSwitchNumberOfPositions() : ModelCommand("read")
    {
        AddArgument("attr-name", "number-of-positions");
        ModelCommand::AddArguments();
    }

    ~ReadSwitchNumberOfPositions()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x003B) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::SwitchCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeNumberOfPositions(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CurrentPosition
 */
class ReadSwitchCurrentPosition : public ModelCommand
{
public:
    ReadSwitchCurrentPosition() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-position");
        ModelCommand::AddArguments();
    }

    ~ReadSwitchCurrentPosition()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x003B) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::SwitchCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentPosition(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportSwitchCurrentPosition : public ModelCommand
{
public:
    ReportSwitchCurrentPosition() : ModelCommand("report")
    {
        AddArgument("attr-name", "current-position");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", 0, UINT8_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportSwitchCurrentPosition()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x003B) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::SwitchCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeCurrentPosition(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeCurrentPosition(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                         mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int8uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    uint8_t mChange;
};

/*
 * Attribute ClusterRevision
 */
class ReadSwitchClusterRevision : public ModelCommand
{
public:
    ReadSwitchClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadSwitchClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x003B) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::SwitchCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster TvChannel                                                   | 0x0504 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * ChangeChannel                                                     |   0x00 |
| * ChangeChannelByNumber                                             |   0x01 |
| * SkipChannel                                                       |   0x02 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * TvChannelList                                                     | 0x0000 |
| * TvChannelLineup                                                   | 0x0001 |
| * CurrentTvChannel                                                  | 0x0002 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command ChangeChannel
 */
class TvChannelChangeChannel : public ModelCommand
{
public:
    TvChannelChangeChannel() : ModelCommand("change-channel")
    {
        AddArgument("Match", &mMatch);
        ModelCommand::AddArguments();
    }
    ~TvChannelChangeChannel()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0504) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TvChannelCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ChangeChannel(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                     chip::ByteSpan(chip::Uint8::from_char(mMatch), strlen(mMatch)));
    }

private:
    chip::Callback::Callback<TvChannelClusterChangeChannelResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<TvChannelClusterChangeChannelResponseCallback>(OnTvChannelClusterChangeChannelResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mMatch;
};

/*
 * Command ChangeChannelByNumber
 */
class TvChannelChangeChannelByNumber : public ModelCommand
{
public:
    TvChannelChangeChannelByNumber() : ModelCommand("change-channel-by-number")
    {
        AddArgument("MajorNumber", 0, UINT16_MAX, &mMajorNumber);
        AddArgument("MinorNumber", 0, UINT16_MAX, &mMinorNumber);
        ModelCommand::AddArguments();
    }
    ~TvChannelChangeChannelByNumber()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0504) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::TvChannelCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ChangeChannelByNumber(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMajorNumber, mMinorNumber);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mMajorNumber;
    uint16_t mMinorNumber;
};

/*
 * Command SkipChannel
 */
class TvChannelSkipChannel : public ModelCommand
{
public:
    TvChannelSkipChannel() : ModelCommand("skip-channel")
    {
        AddArgument("Count", 0, UINT16_MAX, &mCount);
        ModelCommand::AddArguments();
    }
    ~TvChannelSkipChannel()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0504) command (0x02) on endpoint %" PRIu8, endpointId);

        chip::Controller::TvChannelCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SkipChannel(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mCount);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mCount;
};

/*
 * Discover Attributes
 */
class DiscoverTvChannelAttributes : public ModelCommand
{
public:
    DiscoverTvChannelAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverTvChannelAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::TvChannelCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute TvChannelList
 */
class ReadTvChannelTvChannelList : public ModelCommand
{
public:
    ReadTvChannelTvChannelList() : ModelCommand("read")
    {
        AddArgument("attr-name", "tv-channel-list");
        ModelCommand::AddArguments();
    }

    ~ReadTvChannelTvChannelList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0504) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TvChannelCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTvChannelList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<TvChannelTvChannelListListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<TvChannelTvChannelListListAttributeCallback>(OnTvChannelTvChannelListListAttributeResponse,
                                                                                  this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute TvChannelLineup
 */
class ReadTvChannelTvChannelLineup : public ModelCommand
{
public:
    ReadTvChannelTvChannelLineup() : ModelCommand("read")
    {
        AddArgument("attr-name", "tv-channel-lineup");
        ModelCommand::AddArguments();
    }

    ~ReadTvChannelTvChannelLineup()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0504) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TvChannelCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTvChannelLineup(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CurrentTvChannel
 */
class ReadTvChannelCurrentTvChannel : public ModelCommand
{
public:
    ReadTvChannelCurrentTvChannel() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-tv-channel");
        ModelCommand::AddArguments();
    }

    ~ReadTvChannelCurrentTvChannel()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0504) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TvChannelCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentTvChannel(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadTvChannelClusterRevision : public ModelCommand
{
public:
    ReadTvChannelClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadTvChannelClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0504) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TvChannelCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster TargetNavigator                                             | 0x0505 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * NavigateTarget                                                    |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * TargetNavigatorList                                               | 0x0000 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command NavigateTarget
 */
class TargetNavigatorNavigateTarget : public ModelCommand
{
public:
    TargetNavigatorNavigateTarget() : ModelCommand("navigate-target")
    {
        AddArgument("Target", 0, UINT8_MAX, &mTarget);
        AddArgument("Data", &mData);
        ModelCommand::AddArguments();
    }
    ~TargetNavigatorNavigateTarget()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0505) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TargetNavigatorCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.NavigateTarget(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mTarget,
                                      chip::ByteSpan(chip::Uint8::from_char(mData), strlen(mData)));
    }

private:
    chip::Callback::Callback<TargetNavigatorClusterNavigateTargetResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<TargetNavigatorClusterNavigateTargetResponseCallback>(
            OnTargetNavigatorClusterNavigateTargetResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mTarget;
    char * mData;
};

/*
 * Discover Attributes
 */
class DiscoverTargetNavigatorAttributes : public ModelCommand
{
public:
    DiscoverTargetNavigatorAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverTargetNavigatorAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::TargetNavigatorCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute TargetNavigatorList
 */
class ReadTargetNavigatorTargetNavigatorList : public ModelCommand
{
public:
    ReadTargetNavigatorTargetNavigatorList() : ModelCommand("read")
    {
        AddArgument("attr-name", "target-navigator-list");
        ModelCommand::AddArguments();
    }

    ~ReadTargetNavigatorTargetNavigatorList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0505) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TargetNavigatorCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTargetNavigatorList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<TargetNavigatorTargetNavigatorListListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<TargetNavigatorTargetNavigatorListListAttributeCallback>(
            OnTargetNavigatorTargetNavigatorListListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadTargetNavigatorClusterRevision : public ModelCommand
{
public:
    ReadTargetNavigatorClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadTargetNavigatorClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0505) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TargetNavigatorCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster TemperatureMeasurement                                      | 0x0402 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * MeasuredValue                                                     | 0x0000 |
| * MinMeasuredValue                                                  | 0x0001 |
| * MaxMeasuredValue                                                  | 0x0002 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Discover Attributes
 */
class DiscoverTemperatureMeasurementAttributes : public ModelCommand
{
public:
    DiscoverTemperatureMeasurementAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverTemperatureMeasurementAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::TemperatureMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute MeasuredValue
 */
class ReadTemperatureMeasurementMeasuredValue : public ModelCommand
{
public:
    ReadTemperatureMeasurementMeasuredValue() : ModelCommand("read")
    {
        AddArgument("attr-name", "measured-value");
        ModelCommand::AddArguments();
    }

    ~ReadTemperatureMeasurementMeasuredValue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0402) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TemperatureMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportTemperatureMeasurementMeasuredValue : public ModelCommand
{
public:
    ReportTemperatureMeasurementMeasuredValue() : ModelCommand("report")
    {
        AddArgument("attr-name", "measured-value");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", INT16_MIN, INT16_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportTemperatureMeasurementMeasuredValue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0402) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::TemperatureMeasurementCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeMeasuredValue(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                       mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int16sAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    int16_t mChange;
};

/*
 * Attribute MinMeasuredValue
 */
class ReadTemperatureMeasurementMinMeasuredValue : public ModelCommand
{
public:
    ReadTemperatureMeasurementMinMeasuredValue() : ModelCommand("read")
    {
        AddArgument("attr-name", "min-measured-value");
        ModelCommand::AddArguments();
    }

    ~ReadTemperatureMeasurementMinMeasuredValue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0402) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TemperatureMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMinMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute MaxMeasuredValue
 */
class ReadTemperatureMeasurementMaxMeasuredValue : public ModelCommand
{
public:
    ReadTemperatureMeasurementMaxMeasuredValue() : ModelCommand("read")
    {
        AddArgument("attr-name", "max-measured-value");
        ModelCommand::AddArguments();
    }

    ~ReadTemperatureMeasurementMaxMeasuredValue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0402) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TemperatureMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMaxMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadTemperatureMeasurementClusterRevision : public ModelCommand
{
public:
    ReadTemperatureMeasurementClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadTemperatureMeasurementClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0402) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TemperatureMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster TestCluster                                                 | 0x050F |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * Test                                                              |   0x00 |
| * TestNotHandled                                                    |   0x01 |
| * TestSpecific                                                      |   0x02 |
| * TestUnknownCommand                                                |   0x03 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * Boolean                                                           | 0x0000 |
| * Bitmap8                                                           | 0x0001 |
| * Bitmap16                                                          | 0x0002 |
| * Bitmap32                                                          | 0x0003 |
| * Bitmap64                                                          | 0x0004 |
| * Int8u                                                             | 0x0005 |
| * Int16u                                                            | 0x0006 |
| * Int32u                                                            | 0x0008 |
| * Int64u                                                            | 0x000C |
| * Int8s                                                             | 0x000D |
| * Int16s                                                            | 0x000E |
| * Int32s                                                            | 0x0010 |
| * Int64s                                                            | 0x0014 |
| * Enum8                                                             | 0x0015 |
| * Enum16                                                            | 0x0016 |
| * OctetString                                                       | 0x0019 |
| * ListInt8u                                                         | 0x001A |
| * ListOctetString                                                   | 0x001B |
| * ListStructOctetString                                             | 0x001C |
| * LongOctetString                                                   | 0x001D |
| * CharString                                                        | 0x001E |
| * LongCharString                                                    | 0x001F |
| * Unsupported                                                       | 0x00FF |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command Test
 */
class TestClusterTest : public ModelCommand
{
public:
    TestClusterTest() : ModelCommand("test") { ModelCommand::AddArguments(); }
    ~TestClusterTest()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.Test(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command TestNotHandled
 */
class TestClusterTestNotHandled : public ModelCommand
{
public:
    TestClusterTestNotHandled() : ModelCommand("test-not-handled") { ModelCommand::AddArguments(); }
    ~TestClusterTestNotHandled()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.TestNotHandled(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command TestSpecific
 */
class TestClusterTestSpecific : public ModelCommand
{
public:
    TestClusterTestSpecific() : ModelCommand("test-specific") { ModelCommand::AddArguments(); }
    ~TestClusterTestSpecific()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x02) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.TestSpecific(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<TestClusterClusterTestSpecificResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<TestClusterClusterTestSpecificResponseCallback>(OnTestClusterClusterTestSpecificResponse,
                                                                                     this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command TestUnknownCommand
 */
class TestClusterTestUnknownCommand : public ModelCommand
{
public:
    TestClusterTestUnknownCommand() : ModelCommand("test-unknown-command") { ModelCommand::AddArguments(); }
    ~TestClusterTestUnknownCommand()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x03) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.TestUnknownCommand(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Discover Attributes
 */
class DiscoverTestClusterAttributes : public ModelCommand
{
public:
    DiscoverTestClusterAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverTestClusterAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Boolean
 */
class ReadTestClusterBoolean : public ModelCommand
{
public:
    ReadTestClusterBoolean() : ModelCommand("read")
    {
        AddArgument("attr-name", "boolean");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterBoolean()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeBoolean(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<BooleanAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterBoolean : public ModelCommand
{
public:
    WriteTestClusterBoolean() : ModelCommand("write")
    {
        AddArgument("attr-name", "boolean");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterBoolean()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeBoolean(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute Bitmap8
 */
class ReadTestClusterBitmap8 : public ModelCommand
{
public:
    ReadTestClusterBitmap8() : ModelCommand("read")
    {
        AddArgument("attr-name", "bitmap8");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterBitmap8()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeBitmap8(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterBitmap8 : public ModelCommand
{
public:
    WriteTestClusterBitmap8() : ModelCommand("write")
    {
        AddArgument("attr-name", "bitmap8");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterBitmap8()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeBitmap8(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute Bitmap16
 */
class ReadTestClusterBitmap16 : public ModelCommand
{
public:
    ReadTestClusterBitmap16() : ModelCommand("read")
    {
        AddArgument("attr-name", "bitmap16");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterBitmap16()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeBitmap16(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterBitmap16 : public ModelCommand
{
public:
    WriteTestClusterBitmap16() : ModelCommand("write")
    {
        AddArgument("attr-name", "bitmap16");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterBitmap16()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeBitmap16(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute Bitmap32
 */
class ReadTestClusterBitmap32 : public ModelCommand
{
public:
    ReadTestClusterBitmap32() : ModelCommand("read")
    {
        AddArgument("attr-name", "bitmap32");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterBitmap32()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeBitmap32(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterBitmap32 : public ModelCommand
{
public:
    WriteTestClusterBitmap32() : ModelCommand("write")
    {
        AddArgument("attr-name", "bitmap32");
        AddArgument("attr-value", 0, UINT32_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterBitmap32()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeBitmap32(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint32_t mValue;
};

/*
 * Attribute Bitmap64
 */
class ReadTestClusterBitmap64 : public ModelCommand
{
public:
    ReadTestClusterBitmap64() : ModelCommand("read")
    {
        AddArgument("attr-name", "bitmap64");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterBitmap64()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeBitmap64(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int64uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int64uAttributeCallback>(OnInt64uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterBitmap64 : public ModelCommand
{
public:
    WriteTestClusterBitmap64() : ModelCommand("write")
    {
        AddArgument("attr-name", "bitmap64");
        AddArgument("attr-value", 0, UINT64_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterBitmap64()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeBitmap64(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint64_t mValue;
};

/*
 * Attribute Int8u
 */
class ReadTestClusterInt8u : public ModelCommand
{
public:
    ReadTestClusterInt8u() : ModelCommand("read")
    {
        AddArgument("attr-name", "int8u");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterInt8u()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeInt8u(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterInt8u : public ModelCommand
{
public:
    WriteTestClusterInt8u() : ModelCommand("write")
    {
        AddArgument("attr-name", "int8u");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterInt8u()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeInt8u(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute Int16u
 */
class ReadTestClusterInt16u : public ModelCommand
{
public:
    ReadTestClusterInt16u() : ModelCommand("read")
    {
        AddArgument("attr-name", "int16u");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterInt16u()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeInt16u(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterInt16u : public ModelCommand
{
public:
    WriteTestClusterInt16u() : ModelCommand("write")
    {
        AddArgument("attr-name", "int16u");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterInt16u()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeInt16u(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute Int32u
 */
class ReadTestClusterInt32u : public ModelCommand
{
public:
    ReadTestClusterInt32u() : ModelCommand("read")
    {
        AddArgument("attr-name", "int32u");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterInt32u()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeInt32u(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterInt32u : public ModelCommand
{
public:
    WriteTestClusterInt32u() : ModelCommand("write")
    {
        AddArgument("attr-name", "int32u");
        AddArgument("attr-value", 0, UINT32_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterInt32u()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeInt32u(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint32_t mValue;
};

/*
 * Attribute Int64u
 */
class ReadTestClusterInt64u : public ModelCommand
{
public:
    ReadTestClusterInt64u() : ModelCommand("read")
    {
        AddArgument("attr-name", "int64u");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterInt64u()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeInt64u(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int64uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int64uAttributeCallback>(OnInt64uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterInt64u : public ModelCommand
{
public:
    WriteTestClusterInt64u() : ModelCommand("write")
    {
        AddArgument("attr-name", "int64u");
        AddArgument("attr-value", 0, UINT64_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterInt64u()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeInt64u(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint64_t mValue;
};

/*
 * Attribute Int8s
 */
class ReadTestClusterInt8s : public ModelCommand
{
public:
    ReadTestClusterInt8s() : ModelCommand("read")
    {
        AddArgument("attr-name", "int8s");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterInt8s()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeInt8s(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8sAttributeCallback>(OnInt8sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterInt8s : public ModelCommand
{
public:
    WriteTestClusterInt8s() : ModelCommand("write")
    {
        AddArgument("attr-name", "int8s");
        AddArgument("attr-value", INT8_MIN, INT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterInt8s()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeInt8s(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    int8_t mValue;
};

/*
 * Attribute Int16s
 */
class ReadTestClusterInt16s : public ModelCommand
{
public:
    ReadTestClusterInt16s() : ModelCommand("read")
    {
        AddArgument("attr-name", "int16s");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterInt16s()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeInt16s(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterInt16s : public ModelCommand
{
public:
    WriteTestClusterInt16s() : ModelCommand("write")
    {
        AddArgument("attr-name", "int16s");
        AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterInt16s()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeInt16s(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    int16_t mValue;
};

/*
 * Attribute Int32s
 */
class ReadTestClusterInt32s : public ModelCommand
{
public:
    ReadTestClusterInt32s() : ModelCommand("read")
    {
        AddArgument("attr-name", "int32s");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterInt32s()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeInt32s(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32sAttributeCallback>(OnInt32sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterInt32s : public ModelCommand
{
public:
    WriteTestClusterInt32s() : ModelCommand("write")
    {
        AddArgument("attr-name", "int32s");
        AddArgument("attr-value", INT32_MIN, INT32_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterInt32s()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeInt32s(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    int32_t mValue;
};

/*
 * Attribute Int64s
 */
class ReadTestClusterInt64s : public ModelCommand
{
public:
    ReadTestClusterInt64s() : ModelCommand("read")
    {
        AddArgument("attr-name", "int64s");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterInt64s()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeInt64s(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int64sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int64sAttributeCallback>(OnInt64sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterInt64s : public ModelCommand
{
public:
    WriteTestClusterInt64s() : ModelCommand("write")
    {
        AddArgument("attr-name", "int64s");
        AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterInt64s()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeInt64s(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    int64_t mValue;
};

/*
 * Attribute Enum8
 */
class ReadTestClusterEnum8 : public ModelCommand
{
public:
    ReadTestClusterEnum8() : ModelCommand("read")
    {
        AddArgument("attr-name", "enum8");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterEnum8()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeEnum8(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterEnum8 : public ModelCommand
{
public:
    WriteTestClusterEnum8() : ModelCommand("write")
    {
        AddArgument("attr-name", "enum8");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterEnum8()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeEnum8(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute Enum16
 */
class ReadTestClusterEnum16 : public ModelCommand
{
public:
    ReadTestClusterEnum16() : ModelCommand("read")
    {
        AddArgument("attr-name", "enum16");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterEnum16()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeEnum16(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterEnum16 : public ModelCommand
{
public:
    WriteTestClusterEnum16() : ModelCommand("write")
    {
        AddArgument("attr-name", "enum16");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterEnum16()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeEnum16(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute OctetString
 */
class ReadTestClusterOctetString : public ModelCommand
{
public:
    ReadTestClusterOctetString() : ModelCommand("read")
    {
        AddArgument("attr-name", "octet-string");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterOctetString()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeOctetString(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterOctetString : public ModelCommand
{
public:
    WriteTestClusterOctetString() : ModelCommand("write")
    {
        AddArgument("attr-name", "octet-string");
        AddArgument("attr-value", &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterOctetString()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeOctetString(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::ByteSpan mValue;
};

/*
 * Attribute ListInt8u
 */
class ReadTestClusterListInt8u : public ModelCommand
{
public:
    ReadTestClusterListInt8u() : ModelCommand("read")
    {
        AddArgument("attr-name", "list-int8u");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterListInt8u()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeListInt8u(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<TestClusterListInt8uListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<TestClusterListInt8uListAttributeCallback>(OnTestClusterListInt8uListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ListOctetString
 */
class ReadTestClusterListOctetString : public ModelCommand
{
public:
    ReadTestClusterListOctetString() : ModelCommand("read")
    {
        AddArgument("attr-name", "list-octet-string");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterListOctetString()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeListOctetString(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<TestClusterListOctetStringListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<TestClusterListOctetStringListAttributeCallback>(
            OnTestClusterListOctetStringListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ListStructOctetString
 */
class ReadTestClusterListStructOctetString : public ModelCommand
{
public:
    ReadTestClusterListStructOctetString() : ModelCommand("read")
    {
        AddArgument("attr-name", "list-struct-octet-string");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterListStructOctetString()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeListStructOctetString(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<TestClusterListStructOctetStringListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<TestClusterListStructOctetStringListAttributeCallback>(
            OnTestClusterListStructOctetStringListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute LongOctetString
 */
class ReadTestClusterLongOctetString : public ModelCommand
{
public:
    ReadTestClusterLongOctetString() : ModelCommand("read")
    {
        AddArgument("attr-name", "long-octet-string");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterLongOctetString()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeLongOctetString(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterLongOctetString : public ModelCommand
{
public:
    WriteTestClusterLongOctetString() : ModelCommand("write")
    {
        AddArgument("attr-name", "long-octet-string");
        AddArgument("attr-value", &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterLongOctetString()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeLongOctetString(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::ByteSpan mValue;
};

/*
 * Attribute CharString
 */
class ReadTestClusterCharString : public ModelCommand
{
public:
    ReadTestClusterCharString() : ModelCommand("read")
    {
        AddArgument("attr-name", "char-string");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterCharString()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCharString(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterCharString : public ModelCommand
{
public:
    WriteTestClusterCharString() : ModelCommand("write")
    {
        AddArgument("attr-name", "char-string");
        AddArgument("attr-value", &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterCharString()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeCharString(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                                chip::ByteSpan(chip::Uint8::from_char(mValue), strlen(mValue)));
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mValue;
};

/*
 * Attribute LongCharString
 */
class ReadTestClusterLongCharString : public ModelCommand
{
public:
    ReadTestClusterLongCharString() : ModelCommand("read")
    {
        AddArgument("attr-name", "long-char-string");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterLongCharString()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeLongCharString(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterLongCharString : public ModelCommand
{
public:
    WriteTestClusterLongCharString() : ModelCommand("write")
    {
        AddArgument("attr-name", "long-char-string");
        AddArgument("attr-value", &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterLongCharString()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeLongCharString(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                                    chip::ByteSpan(chip::Uint8::from_char(mValue), strlen(mValue)));
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mValue;
};

/*
 * Attribute Unsupported
 */
class ReadTestClusterUnsupported : public ModelCommand
{
public:
    ReadTestClusterUnsupported() : ModelCommand("read")
    {
        AddArgument("attr-name", "unsupported");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterUnsupported()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeUnsupported(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<BooleanAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterUnsupported : public ModelCommand
{
public:
    WriteTestClusterUnsupported() : ModelCommand("write")
    {
        AddArgument("attr-name", "unsupported");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterUnsupported()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeUnsupported(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute ClusterRevision
 */
class ReadTestClusterClusterRevision : public ModelCommand
{
public:
    ReadTestClusterClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster Thermostat                                                  | 0x0201 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * ClearWeeklySchedule                                               |   0x03 |
| * GetRelayStatusLog                                                 |   0x04 |
| * GetWeeklySchedule                                                 |   0x02 |
| * SetWeeklySchedule                                                 |   0x01 |
| * SetpointRaiseLower                                                |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * LocalTemperature                                                  | 0x0000 |
| * OccupiedCoolingSetpoint                                           | 0x0011 |
| * OccupiedHeatingSetpoint                                           | 0x0012 |
| * ControlSequenceOfOperation                                        | 0x001B |
| * SystemMode                                                        | 0x001C |
| * StartOfWeek                                                       | 0x0020 |
| * NumberOfWeeklyTransitions                                         | 0x0021 |
| * NumberOfDailyTransitions                                          | 0x0022 |
| * FeatureMap                                                        | 0xFFFC |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command ClearWeeklySchedule
 */
class ThermostatClearWeeklySchedule : public ModelCommand
{
public:
    ThermostatClearWeeklySchedule() : ModelCommand("clear-weekly-schedule") { ModelCommand::AddArguments(); }
    ~ThermostatClearWeeklySchedule()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x03) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ClearWeeklySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command GetRelayStatusLog
 */
class ThermostatGetRelayStatusLog : public ModelCommand
{
public:
    ThermostatGetRelayStatusLog() : ModelCommand("get-relay-status-log") { ModelCommand::AddArguments(); }
    ~ThermostatGetRelayStatusLog()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x04) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetRelayStatusLog(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command GetWeeklySchedule
 */
class ThermostatGetWeeklySchedule : public ModelCommand
{
public:
    ThermostatGetWeeklySchedule() : ModelCommand("get-weekly-schedule")
    {
        AddArgument("DaysToReturn", 0, UINT8_MAX, &mDaysToReturn);
        AddArgument("ModeToReturn", 0, UINT8_MAX, &mModeToReturn);
        ModelCommand::AddArguments();
    }
    ~ThermostatGetWeeklySchedule()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x02) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetWeeklySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mDaysToReturn, mModeToReturn);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mDaysToReturn;
    uint8_t mModeToReturn;
};

/*
 * Command SetWeeklySchedule
 */
class ThermostatSetWeeklySchedule : public ModelCommand
{
public:
    ThermostatSetWeeklySchedule() : ModelCommand("set-weekly-schedule")
    {
        AddArgument("NumberOfTransitionsForSequence", 0, UINT8_MAX, &mNumberOfTransitionsForSequence);
        AddArgument("DayOfWeekForSequence", 0, UINT8_MAX, &mDayOfWeekForSequence);
        AddArgument("ModeForSequence", 0, UINT8_MAX, &mModeForSequence);
        AddArgument("Payload", 0, UINT8_MAX, &mPayload);
        ModelCommand::AddArguments();
    }
    ~ThermostatSetWeeklySchedule()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SetWeeklySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mNumberOfTransitionsForSequence,
                                         mDayOfWeekForSequence, mModeForSequence, mPayload);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mNumberOfTransitionsForSequence;
    uint8_t mDayOfWeekForSequence;
    uint8_t mModeForSequence;
    uint8_t mPayload;
};

/*
 * Command SetpointRaiseLower
 */
class ThermostatSetpointRaiseLower : public ModelCommand
{
public:
    ThermostatSetpointRaiseLower() : ModelCommand("setpoint-raise-lower")
    {
        AddArgument("Mode", 0, UINT8_MAX, &mMode);
        AddArgument("Amount", INT8_MIN, INT8_MAX, &mAmount);
        ModelCommand::AddArguments();
    }
    ~ThermostatSetpointRaiseLower()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SetpointRaiseLower(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMode, mAmount);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mMode;
    int8_t mAmount;
};

/*
 * Discover Attributes
 */
class DiscoverThermostatAttributes : public ModelCommand
{
public:
    DiscoverThermostatAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverThermostatAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute LocalTemperature
 */
class ReadThermostatLocalTemperature : public ModelCommand
{
public:
    ReadThermostatLocalTemperature() : ModelCommand("read")
    {
        AddArgument("attr-name", "local-temperature");
        ModelCommand::AddArguments();
    }

    ~ReadThermostatLocalTemperature()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeLocalTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportThermostatLocalTemperature : public ModelCommand
{
public:
    ReportThermostatLocalTemperature() : ModelCommand("report")
    {
        AddArgument("attr-name", "local-temperature");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", INT16_MIN, INT16_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportThermostatLocalTemperature()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeLocalTemperature(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeLocalTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                          mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int16sAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    int16_t mChange;
};

/*
 * Attribute OccupiedCoolingSetpoint
 */
class ReadThermostatOccupiedCoolingSetpoint : public ModelCommand
{
public:
    ReadThermostatOccupiedCoolingSetpoint() : ModelCommand("read")
    {
        AddArgument("attr-name", "occupied-cooling-setpoint");
        ModelCommand::AddArguments();
    }

    ~ReadThermostatOccupiedCoolingSetpoint()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeOccupiedCoolingSetpoint(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteThermostatOccupiedCoolingSetpoint : public ModelCommand
{
public:
    WriteThermostatOccupiedCoolingSetpoint() : ModelCommand("write")
    {
        AddArgument("attr-name", "occupied-cooling-setpoint");
        AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteThermostatOccupiedCoolingSetpoint()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeOccupiedCoolingSetpoint(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    int16_t mValue;
};

/*
 * Attribute OccupiedHeatingSetpoint
 */
class ReadThermostatOccupiedHeatingSetpoint : public ModelCommand
{
public:
    ReadThermostatOccupiedHeatingSetpoint() : ModelCommand("read")
    {
        AddArgument("attr-name", "occupied-heating-setpoint");
        ModelCommand::AddArguments();
    }

    ~ReadThermostatOccupiedHeatingSetpoint()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeOccupiedHeatingSetpoint(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteThermostatOccupiedHeatingSetpoint : public ModelCommand
{
public:
    WriteThermostatOccupiedHeatingSetpoint() : ModelCommand("write")
    {
        AddArgument("attr-name", "occupied-heating-setpoint");
        AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteThermostatOccupiedHeatingSetpoint()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeOccupiedHeatingSetpoint(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    int16_t mValue;
};

/*
 * Attribute ControlSequenceOfOperation
 */
class ReadThermostatControlSequenceOfOperation : public ModelCommand
{
public:
    ReadThermostatControlSequenceOfOperation() : ModelCommand("read")
    {
        AddArgument("attr-name", "control-sequence-of-operation");
        ModelCommand::AddArguments();
    }

    ~ReadThermostatControlSequenceOfOperation()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeControlSequenceOfOperation(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteThermostatControlSequenceOfOperation : public ModelCommand
{
public:
    WriteThermostatControlSequenceOfOperation() : ModelCommand("write")
    {
        AddArgument("attr-name", "control-sequence-of-operation");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteThermostatControlSequenceOfOperation()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeControlSequenceOfOperation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute SystemMode
 */
class ReadThermostatSystemMode : public ModelCommand
{
public:
    ReadThermostatSystemMode() : ModelCommand("read")
    {
        AddArgument("attr-name", "system-mode");
        ModelCommand::AddArguments();
    }

    ~ReadThermostatSystemMode()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeSystemMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteThermostatSystemMode : public ModelCommand
{
public:
    WriteThermostatSystemMode() : ModelCommand("write")
    {
        AddArgument("attr-name", "system-mode");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteThermostatSystemMode()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeSystemMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute StartOfWeek
 */
class ReadThermostatStartOfWeek : public ModelCommand
{
public:
    ReadThermostatStartOfWeek() : ModelCommand("read")
    {
        AddArgument("attr-name", "start-of-week");
        ModelCommand::AddArguments();
    }

    ~ReadThermostatStartOfWeek()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeStartOfWeek(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute NumberOfWeeklyTransitions
 */
class ReadThermostatNumberOfWeeklyTransitions : public ModelCommand
{
public:
    ReadThermostatNumberOfWeeklyTransitions() : ModelCommand("read")
    {
        AddArgument("attr-name", "number-of-weekly-transitions");
        ModelCommand::AddArguments();
    }

    ~ReadThermostatNumberOfWeeklyTransitions()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeNumberOfWeeklyTransitions(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute NumberOfDailyTransitions
 */
class ReadThermostatNumberOfDailyTransitions : public ModelCommand
{
public:
    ReadThermostatNumberOfDailyTransitions() : ModelCommand("read")
    {
        AddArgument("attr-name", "number-of-daily-transitions");
        ModelCommand::AddArguments();
    }

    ~ReadThermostatNumberOfDailyTransitions()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeNumberOfDailyTransitions(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute FeatureMap
 */
class ReadThermostatFeatureMap : public ModelCommand
{
public:
    ReadThermostatFeatureMap() : ModelCommand("read")
    {
        AddArgument("attr-name", "feature-map");
        ModelCommand::AddArguments();
    }

    ~ReadThermostatFeatureMap()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeFeatureMap(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadThermostatClusterRevision : public ModelCommand
{
public:
    ReadThermostatClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadThermostatClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster ThreadNetworkDiagnostics                                    | 0x0035 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * ResetCounts                                                       |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * Channel                                                           | 0x0000 |
| * RoutingRole                                                       | 0x0001 |
| * NetworkName                                                       | 0x0002 |
| * PanId                                                             | 0x0003 |
| * ExtendedPanId                                                     | 0x0004 |
| * MeshLocalPrefix                                                   | 0x0005 |
| * OverrunCount                                                      | 0x0006 |
| * NeighborTableList                                                 | 0x0007 |
| * RouteTableList                                                    | 0x0008 |
| * PartitionId                                                       | 0x0009 |
| * Weighting                                                         | 0x000A |
| * DataVersion                                                       | 0x000B |
| * StableDataVersion                                                 | 0x000C |
| * LeaderRouterId                                                    | 0x000D |
| * DetachedRoleCount                                                 | 0x000E |
| * ChildRoleCount                                                    | 0x000F |
| * RouterRoleCount                                                   | 0x0010 |
| * LeaderRoleCount                                                   | 0x0011 |
| * AttachAttemptCount                                                | 0x0012 |
| * PartitionIdChangeCount                                            | 0x0013 |
| * BetterPartitionAttachAttemptCount                                 | 0x0014 |
| * ParentChangeCount                                                 | 0x0015 |
| * TxTotalCount                                                      | 0x0016 |
| * TxUnicastCount                                                    | 0x0017 |
| * TxBroadcastCount                                                  | 0x0018 |
| * TxAckRequestedCount                                               | 0x0019 |
| * TxAckedCount                                                      | 0x001A |
| * TxNoAckRequestedCount                                             | 0x001B |
| * TxDataCount                                                       | 0x001C |
| * TxDataPollCount                                                   | 0x001D |
| * TxBeaconCount                                                     | 0x001E |
| * TxBeaconRequestCount                                              | 0x001F |
| * TxOtherCount                                                      | 0x0020 |
| * TxRetryCount                                                      | 0x0021 |
| * TxDirectMaxRetryExpiryCount                                       | 0x0022 |
| * TxIndirectMaxRetryExpiryCount                                     | 0x0023 |
| * TxErrCcaCount                                                     | 0x0024 |
| * TxErrAbortCount                                                   | 0x0025 |
| * TxErrBusyChannelCount                                             | 0x0026 |
| * RxTotalCount                                                      | 0x0027 |
| * RxUnicastCount                                                    | 0x0028 |
| * RxBroadcastCount                                                  | 0x0029 |
| * RxDataCount                                                       | 0x002A |
| * RxDataPollCount                                                   | 0x002B |
| * RxBeaconCount                                                     | 0x002C |
| * RxBeaconRequestCount                                              | 0x002D |
| * RxOtherCount                                                      | 0x002E |
| * RxAddressFilteredCount                                            | 0x002F |
| * RxDestAddrFilteredCount                                           | 0x0030 |
| * RxDuplicatedCount                                                 | 0x0031 |
| * RxErrNoFrameCount                                                 | 0x0032 |
| * RxErrUnknownNeighborCount                                         | 0x0033 |
| * RxErrInvalidSrcAddrCount                                          | 0x0034 |
| * RxErrSecCount                                                     | 0x0035 |
| * RxErrFcsCount                                                     | 0x0036 |
| * RxErrOtherCount                                                   | 0x0037 |
| * SecurityPolicy                                                    | 0x003B |
| * ChannelMask                                                       | 0x003C |
| * OperationalDatasetComponents                                      | 0x003D |
| * ActiveNetworkFaultsList                                           | 0x003E |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command ResetCounts
 */
class ThreadNetworkDiagnosticsResetCounts : public ModelCommand
{
public:
    ThreadNetworkDiagnosticsResetCounts() : ModelCommand("reset-counts") { ModelCommand::AddArguments(); }
    ~ThreadNetworkDiagnosticsResetCounts()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ResetCounts(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Discover Attributes
 */
class DiscoverThreadNetworkDiagnosticsAttributes : public ModelCommand
{
public:
    DiscoverThreadNetworkDiagnosticsAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverThreadNetworkDiagnosticsAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Channel
 */
class ReadThreadNetworkDiagnosticsChannel : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsChannel() : ModelCommand("read")
    {
        AddArgument("attr-name", "channel");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsChannel()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeChannel(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RoutingRole
 */
class ReadThreadNetworkDiagnosticsRoutingRole : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsRoutingRole() : ModelCommand("read")
    {
        AddArgument("attr-name", "routing-role");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsRoutingRole()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRoutingRole(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute NetworkName
 */
class ReadThreadNetworkDiagnosticsNetworkName : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsNetworkName() : ModelCommand("read")
    {
        AddArgument("attr-name", "network-name");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsNetworkName()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeNetworkName(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute PanId
 */
class ReadThreadNetworkDiagnosticsPanId : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsPanId() : ModelCommand("read")
    {
        AddArgument("attr-name", "pan-id");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsPanId()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePanId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ExtendedPanId
 */
class ReadThreadNetworkDiagnosticsExtendedPanId : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsExtendedPanId() : ModelCommand("read")
    {
        AddArgument("attr-name", "extended-pan-id");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsExtendedPanId()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeExtendedPanId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int64uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int64uAttributeCallback>(OnInt64uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute MeshLocalPrefix
 */
class ReadThreadNetworkDiagnosticsMeshLocalPrefix : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsMeshLocalPrefix() : ModelCommand("read")
    {
        AddArgument("attr-name", "mesh-local-prefix");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsMeshLocalPrefix()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMeshLocalPrefix(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute OverrunCount
 */
class ReadThreadNetworkDiagnosticsOverrunCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsOverrunCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "overrun-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsOverrunCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeOverrunCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int64uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int64uAttributeCallback>(OnInt64uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute NeighborTableList
 */
class ReadThreadNetworkDiagnosticsNeighborTableList : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsNeighborTableList() : ModelCommand("read")
    {
        AddArgument("attr-name", "neighbor-table-list");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsNeighborTableList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeNeighborTableList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<ThreadNetworkDiagnosticsNeighborTableListListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<ThreadNetworkDiagnosticsNeighborTableListListAttributeCallback>(
            OnThreadNetworkDiagnosticsNeighborTableListListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RouteTableList
 */
class ReadThreadNetworkDiagnosticsRouteTableList : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsRouteTableList() : ModelCommand("read")
    {
        AddArgument("attr-name", "route-table-list");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsRouteTableList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRouteTableList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<ThreadNetworkDiagnosticsRouteTableListListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<ThreadNetworkDiagnosticsRouteTableListListAttributeCallback>(
            OnThreadNetworkDiagnosticsRouteTableListListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute PartitionId
 */
class ReadThreadNetworkDiagnosticsPartitionId : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsPartitionId() : ModelCommand("read")
    {
        AddArgument("attr-name", "partition-id");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsPartitionId()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePartitionId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Weighting
 */
class ReadThreadNetworkDiagnosticsWeighting : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsWeighting() : ModelCommand("read")
    {
        AddArgument("attr-name", "weighting");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsWeighting()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeWeighting(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute DataVersion
 */
class ReadThreadNetworkDiagnosticsDataVersion : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsDataVersion() : ModelCommand("read")
    {
        AddArgument("attr-name", "data-version");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsDataVersion()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeDataVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute StableDataVersion
 */
class ReadThreadNetworkDiagnosticsStableDataVersion : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsStableDataVersion() : ModelCommand("read")
    {
        AddArgument("attr-name", "stable-data-version");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsStableDataVersion()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeStableDataVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute LeaderRouterId
 */
class ReadThreadNetworkDiagnosticsLeaderRouterId : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsLeaderRouterId() : ModelCommand("read")
    {
        AddArgument("attr-name", "leader-router-id");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsLeaderRouterId()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeLeaderRouterId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute DetachedRoleCount
 */
class ReadThreadNetworkDiagnosticsDetachedRoleCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsDetachedRoleCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "detached-role-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsDetachedRoleCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeDetachedRoleCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ChildRoleCount
 */
class ReadThreadNetworkDiagnosticsChildRoleCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsChildRoleCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "child-role-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsChildRoleCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeChildRoleCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RouterRoleCount
 */
class ReadThreadNetworkDiagnosticsRouterRoleCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsRouterRoleCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "router-role-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsRouterRoleCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRouterRoleCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute LeaderRoleCount
 */
class ReadThreadNetworkDiagnosticsLeaderRoleCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsLeaderRoleCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "leader-role-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsLeaderRoleCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeLeaderRoleCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute AttachAttemptCount
 */
class ReadThreadNetworkDiagnosticsAttachAttemptCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsAttachAttemptCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "attach-attempt-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsAttachAttemptCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeAttachAttemptCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute PartitionIdChangeCount
 */
class ReadThreadNetworkDiagnosticsPartitionIdChangeCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsPartitionIdChangeCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "partition-id-change-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsPartitionIdChangeCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePartitionIdChangeCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute BetterPartitionAttachAttemptCount
 */
class ReadThreadNetworkDiagnosticsBetterPartitionAttachAttemptCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsBetterPartitionAttachAttemptCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "better-partition-attach-attempt-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsBetterPartitionAttachAttemptCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeBetterPartitionAttachAttemptCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ParentChangeCount
 */
class ReadThreadNetworkDiagnosticsParentChangeCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsParentChangeCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "parent-change-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsParentChangeCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeParentChangeCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute TxTotalCount
 */
class ReadThreadNetworkDiagnosticsTxTotalCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsTxTotalCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "tx-total-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsTxTotalCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTxTotalCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute TxUnicastCount
 */
class ReadThreadNetworkDiagnosticsTxUnicastCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsTxUnicastCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "tx-unicast-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsTxUnicastCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTxUnicastCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute TxBroadcastCount
 */
class ReadThreadNetworkDiagnosticsTxBroadcastCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsTxBroadcastCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "tx-broadcast-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsTxBroadcastCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTxBroadcastCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute TxAckRequestedCount
 */
class ReadThreadNetworkDiagnosticsTxAckRequestedCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsTxAckRequestedCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "tx-ack-requested-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsTxAckRequestedCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTxAckRequestedCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute TxAckedCount
 */
class ReadThreadNetworkDiagnosticsTxAckedCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsTxAckedCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "tx-acked-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsTxAckedCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTxAckedCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute TxNoAckRequestedCount
 */
class ReadThreadNetworkDiagnosticsTxNoAckRequestedCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsTxNoAckRequestedCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "tx-no-ack-requested-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsTxNoAckRequestedCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTxNoAckRequestedCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute TxDataCount
 */
class ReadThreadNetworkDiagnosticsTxDataCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsTxDataCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "tx-data-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsTxDataCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTxDataCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute TxDataPollCount
 */
class ReadThreadNetworkDiagnosticsTxDataPollCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsTxDataPollCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "tx-data-poll-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsTxDataPollCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTxDataPollCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute TxBeaconCount
 */
class ReadThreadNetworkDiagnosticsTxBeaconCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsTxBeaconCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "tx-beacon-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsTxBeaconCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTxBeaconCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute TxBeaconRequestCount
 */
class ReadThreadNetworkDiagnosticsTxBeaconRequestCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsTxBeaconRequestCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "tx-beacon-request-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsTxBeaconRequestCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTxBeaconRequestCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute TxOtherCount
 */
class ReadThreadNetworkDiagnosticsTxOtherCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsTxOtherCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "tx-other-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsTxOtherCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTxOtherCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute TxRetryCount
 */
class ReadThreadNetworkDiagnosticsTxRetryCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsTxRetryCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "tx-retry-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsTxRetryCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTxRetryCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute TxDirectMaxRetryExpiryCount
 */
class ReadThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "tx-direct-max-retry-expiry-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTxDirectMaxRetryExpiryCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute TxIndirectMaxRetryExpiryCount
 */
class ReadThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "tx-indirect-max-retry-expiry-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTxIndirectMaxRetryExpiryCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute TxErrCcaCount
 */
class ReadThreadNetworkDiagnosticsTxErrCcaCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsTxErrCcaCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "tx-err-cca-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsTxErrCcaCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTxErrCcaCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute TxErrAbortCount
 */
class ReadThreadNetworkDiagnosticsTxErrAbortCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsTxErrAbortCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "tx-err-abort-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsTxErrAbortCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTxErrAbortCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute TxErrBusyChannelCount
 */
class ReadThreadNetworkDiagnosticsTxErrBusyChannelCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsTxErrBusyChannelCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "tx-err-busy-channel-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsTxErrBusyChannelCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTxErrBusyChannelCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RxTotalCount
 */
class ReadThreadNetworkDiagnosticsRxTotalCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsRxTotalCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "rx-total-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsRxTotalCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRxTotalCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RxUnicastCount
 */
class ReadThreadNetworkDiagnosticsRxUnicastCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsRxUnicastCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "rx-unicast-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsRxUnicastCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRxUnicastCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RxBroadcastCount
 */
class ReadThreadNetworkDiagnosticsRxBroadcastCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsRxBroadcastCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "rx-broadcast-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsRxBroadcastCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRxBroadcastCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RxDataCount
 */
class ReadThreadNetworkDiagnosticsRxDataCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsRxDataCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "rx-data-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsRxDataCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRxDataCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RxDataPollCount
 */
class ReadThreadNetworkDiagnosticsRxDataPollCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsRxDataPollCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "rx-data-poll-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsRxDataPollCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRxDataPollCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RxBeaconCount
 */
class ReadThreadNetworkDiagnosticsRxBeaconCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsRxBeaconCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "rx-beacon-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsRxBeaconCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRxBeaconCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RxBeaconRequestCount
 */
class ReadThreadNetworkDiagnosticsRxBeaconRequestCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsRxBeaconRequestCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "rx-beacon-request-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsRxBeaconRequestCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRxBeaconRequestCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RxOtherCount
 */
class ReadThreadNetworkDiagnosticsRxOtherCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsRxOtherCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "rx-other-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsRxOtherCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRxOtherCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RxAddressFilteredCount
 */
class ReadThreadNetworkDiagnosticsRxAddressFilteredCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsRxAddressFilteredCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "rx-address-filtered-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsRxAddressFilteredCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRxAddressFilteredCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RxDestAddrFilteredCount
 */
class ReadThreadNetworkDiagnosticsRxDestAddrFilteredCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsRxDestAddrFilteredCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "rx-dest-addr-filtered-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsRxDestAddrFilteredCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRxDestAddrFilteredCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RxDuplicatedCount
 */
class ReadThreadNetworkDiagnosticsRxDuplicatedCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsRxDuplicatedCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "rx-duplicated-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsRxDuplicatedCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRxDuplicatedCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RxErrNoFrameCount
 */
class ReadThreadNetworkDiagnosticsRxErrNoFrameCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsRxErrNoFrameCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "rx-err-no-frame-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsRxErrNoFrameCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRxErrNoFrameCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RxErrUnknownNeighborCount
 */
class ReadThreadNetworkDiagnosticsRxErrUnknownNeighborCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsRxErrUnknownNeighborCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "rx-err-unknown-neighbor-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsRxErrUnknownNeighborCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRxErrUnknownNeighborCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RxErrInvalidSrcAddrCount
 */
class ReadThreadNetworkDiagnosticsRxErrInvalidSrcAddrCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsRxErrInvalidSrcAddrCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "rx-err-invalid-src-addr-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsRxErrInvalidSrcAddrCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRxErrInvalidSrcAddrCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RxErrSecCount
 */
class ReadThreadNetworkDiagnosticsRxErrSecCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsRxErrSecCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "rx-err-sec-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsRxErrSecCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRxErrSecCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RxErrFcsCount
 */
class ReadThreadNetworkDiagnosticsRxErrFcsCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsRxErrFcsCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "rx-err-fcs-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsRxErrFcsCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRxErrFcsCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute RxErrOtherCount
 */
class ReadThreadNetworkDiagnosticsRxErrOtherCount : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsRxErrOtherCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "rx-err-other-count");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsRxErrOtherCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRxErrOtherCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute SecurityPolicy
 */
class ReadThreadNetworkDiagnosticsSecurityPolicy : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsSecurityPolicy() : ModelCommand("read")
    {
        AddArgument("attr-name", "security-policy");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsSecurityPolicy()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeSecurityPolicy(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<ThreadNetworkDiagnosticsSecurityPolicyListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<ThreadNetworkDiagnosticsSecurityPolicyListAttributeCallback>(
            OnThreadNetworkDiagnosticsSecurityPolicyListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ChannelMask
 */
class ReadThreadNetworkDiagnosticsChannelMask : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsChannelMask() : ModelCommand("read")
    {
        AddArgument("attr-name", "channel-mask");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsChannelMask()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeChannelMask(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute OperationalDatasetComponents
 */
class ReadThreadNetworkDiagnosticsOperationalDatasetComponents : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsOperationalDatasetComponents() : ModelCommand("read")
    {
        AddArgument("attr-name", "operational-dataset-components");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsOperationalDatasetComponents()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeOperationalDatasetComponents(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<ThreadNetworkDiagnosticsOperationalDatasetComponentsListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<ThreadNetworkDiagnosticsOperationalDatasetComponentsListAttributeCallback>(
            OnThreadNetworkDiagnosticsOperationalDatasetComponentsListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ActiveNetworkFaultsList
 */
class ReadThreadNetworkDiagnosticsActiveNetworkFaultsList : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsActiveNetworkFaultsList() : ModelCommand("read")
    {
        AddArgument("attr-name", "active-network-faults-list");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsActiveNetworkFaultsList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeActiveNetworkFaultsList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<ThreadNetworkDiagnosticsActiveNetworkFaultsListListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<ThreadNetworkDiagnosticsActiveNetworkFaultsListListAttributeCallback>(
            OnThreadNetworkDiagnosticsActiveNetworkFaultsListListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadThreadNetworkDiagnosticsClusterRevision : public ModelCommand
{
public:
    ReadThreadNetworkDiagnosticsClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadThreadNetworkDiagnosticsClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0035) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::ThreadNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster WakeOnLan                                                   | 0x0503 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * WakeOnLanMacAddress                                               | 0x0000 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Discover Attributes
 */
class DiscoverWakeOnLanAttributes : public ModelCommand
{
public:
    DiscoverWakeOnLanAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverWakeOnLanAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::WakeOnLanCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute WakeOnLanMacAddress
 */
class ReadWakeOnLanWakeOnLanMacAddress : public ModelCommand
{
public:
    ReadWakeOnLanWakeOnLanMacAddress() : ModelCommand("read")
    {
        AddArgument("attr-name", "wake-on-lan-mac-address");
        ModelCommand::AddArguments();
    }

    ~ReadWakeOnLanWakeOnLanMacAddress()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0503) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WakeOnLanCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeWakeOnLanMacAddress(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadWakeOnLanClusterRevision : public ModelCommand
{
public:
    ReadWakeOnLanClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadWakeOnLanClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0503) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WakeOnLanCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster WiFiNetworkDiagnostics                                      | 0x0036 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * ResetCounts                                                       |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * Bssid                                                             | 0x0000 |
| * SecurityType                                                      | 0x0001 |
| * WiFiVersion                                                       | 0x0002 |
| * ChannelNumber                                                     | 0x0003 |
| * Rssi                                                              | 0x0004 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command ResetCounts
 */
class WiFiNetworkDiagnosticsResetCounts : public ModelCommand
{
public:
    WiFiNetworkDiagnosticsResetCounts() : ModelCommand("reset-counts") { ModelCommand::AddArguments(); }
    ~WiFiNetworkDiagnosticsResetCounts()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0036) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WiFiNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ResetCounts(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Discover Attributes
 */
class DiscoverWiFiNetworkDiagnosticsAttributes : public ModelCommand
{
public:
    DiscoverWiFiNetworkDiagnosticsAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverWiFiNetworkDiagnosticsAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::WiFiNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Bssid
 */
class ReadWiFiNetworkDiagnosticsBssid : public ModelCommand
{
public:
    ReadWiFiNetworkDiagnosticsBssid() : ModelCommand("read")
    {
        AddArgument("attr-name", "bssid");
        ModelCommand::AddArguments();
    }

    ~ReadWiFiNetworkDiagnosticsBssid()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0036) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WiFiNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeBssid(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute SecurityType
 */
class ReadWiFiNetworkDiagnosticsSecurityType : public ModelCommand
{
public:
    ReadWiFiNetworkDiagnosticsSecurityType() : ModelCommand("read")
    {
        AddArgument("attr-name", "security-type");
        ModelCommand::AddArguments();
    }

    ~ReadWiFiNetworkDiagnosticsSecurityType()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0036) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WiFiNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeSecurityType(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute WiFiVersion
 */
class ReadWiFiNetworkDiagnosticsWiFiVersion : public ModelCommand
{
public:
    ReadWiFiNetworkDiagnosticsWiFiVersion() : ModelCommand("read")
    {
        AddArgument("attr-name", "wi-fi-version");
        ModelCommand::AddArguments();
    }

    ~ReadWiFiNetworkDiagnosticsWiFiVersion()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0036) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WiFiNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeWiFiVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ChannelNumber
 */
class ReadWiFiNetworkDiagnosticsChannelNumber : public ModelCommand
{
public:
    ReadWiFiNetworkDiagnosticsChannelNumber() : ModelCommand("read")
    {
        AddArgument("attr-name", "channel-number");
        ModelCommand::AddArguments();
    }

    ~ReadWiFiNetworkDiagnosticsChannelNumber()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0036) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WiFiNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeChannelNumber(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Rssi
 */
class ReadWiFiNetworkDiagnosticsRssi : public ModelCommand
{
public:
    ReadWiFiNetworkDiagnosticsRssi() : ModelCommand("read")
    {
        AddArgument("attr-name", "rssi");
        ModelCommand::AddArguments();
    }

    ~ReadWiFiNetworkDiagnosticsRssi()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0036) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WiFiNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRssi(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8sAttributeCallback>(OnInt8sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadWiFiNetworkDiagnosticsClusterRevision : public ModelCommand
{
public:
    ReadWiFiNetworkDiagnosticsClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadWiFiNetworkDiagnosticsClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0036) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WiFiNetworkDiagnosticsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster WindowCovering                                              | 0x0102 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * DownOrClose                                                       |   0x01 |
| * GoToLiftPercentage                                                |   0x05 |
| * GoToLiftValue                                                     |   0x04 |
| * GoToTiltPercentage                                                |   0x08 |
| * GoToTiltValue                                                     |   0x07 |
| * StopMotion                                                        |   0x02 |
| * UpOrOpen                                                          |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * Type                                                              | 0x0000 |
| * CurrentPositionLift                                               | 0x0003 |
| * CurrentPositionTilt                                               | 0x0004 |
| * ConfigStatus                                                      | 0x0007 |
| * CurrentPositionLiftPercentage                                     | 0x0008 |
| * CurrentPositionTiltPercentage                                     | 0x0009 |
| * OperationalStatus                                                 | 0x000A |
| * TargetPositionLiftPercent100ths                                   | 0x000B |
| * TargetPositionTiltPercent100ths                                   | 0x000C |
| * EndProductType                                                    | 0x000D |
| * CurrentPositionLiftPercent100ths                                  | 0x000E |
| * CurrentPositionTiltPercent100ths                                  | 0x000F |
| * InstalledOpenLimitLift                                            | 0x0010 |
| * InstalledClosedLimitLift                                          | 0x0011 |
| * InstalledOpenLimitTilt                                            | 0x0012 |
| * InstalledClosedLimitTilt                                          | 0x0013 |
| * Mode                                                              | 0x0017 |
| * SafetyStatus                                                      | 0x001A |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command DownOrClose
 */
class WindowCoveringDownOrClose : public ModelCommand
{
public:
    WindowCoveringDownOrClose() : ModelCommand("down-or-close") { ModelCommand::AddArguments(); }
    ~WindowCoveringDownOrClose()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DownOrClose(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command GoToLiftPercentage
 */
class WindowCoveringGoToLiftPercentage : public ModelCommand
{
public:
    WindowCoveringGoToLiftPercentage() : ModelCommand("go-to-lift-percentage")
    {
        AddArgument("LiftPercentageValue", 0, UINT8_MAX, &mLiftPercentageValue);
        AddArgument("LiftPercent100thsValue", 0, UINT16_MAX, &mLiftPercent100thsValue);
        ModelCommand::AddArguments();
    }
    ~WindowCoveringGoToLiftPercentage()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x05) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GoToLiftPercentage(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mLiftPercentageValue,
                                          mLiftPercent100thsValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mLiftPercentageValue;
    uint16_t mLiftPercent100thsValue;
};

/*
 * Command GoToLiftValue
 */
class WindowCoveringGoToLiftValue : public ModelCommand
{
public:
    WindowCoveringGoToLiftValue() : ModelCommand("go-to-lift-value")
    {
        AddArgument("LiftValue", 0, UINT16_MAX, &mLiftValue);
        ModelCommand::AddArguments();
    }
    ~WindowCoveringGoToLiftValue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x04) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GoToLiftValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mLiftValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mLiftValue;
};

/*
 * Command GoToTiltPercentage
 */
class WindowCoveringGoToTiltPercentage : public ModelCommand
{
public:
    WindowCoveringGoToTiltPercentage() : ModelCommand("go-to-tilt-percentage")
    {
        AddArgument("TiltPercentageValue", 0, UINT8_MAX, &mTiltPercentageValue);
        AddArgument("TiltPercent100thsValue", 0, UINT16_MAX, &mTiltPercent100thsValue);
        ModelCommand::AddArguments();
    }
    ~WindowCoveringGoToTiltPercentage()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x08) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GoToTiltPercentage(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mTiltPercentageValue,
                                          mTiltPercent100thsValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mTiltPercentageValue;
    uint16_t mTiltPercent100thsValue;
};

/*
 * Command GoToTiltValue
 */
class WindowCoveringGoToTiltValue : public ModelCommand
{
public:
    WindowCoveringGoToTiltValue() : ModelCommand("go-to-tilt-value")
    {
        AddArgument("TiltValue", 0, UINT16_MAX, &mTiltValue);
        ModelCommand::AddArguments();
    }
    ~WindowCoveringGoToTiltValue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x07) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GoToTiltValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mTiltValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mTiltValue;
};

/*
 * Command StopMotion
 */
class WindowCoveringStopMotion : public ModelCommand
{
public:
    WindowCoveringStopMotion() : ModelCommand("stop-motion") { ModelCommand::AddArguments(); }
    ~WindowCoveringStopMotion()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x02) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.StopMotion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command UpOrOpen
 */
class WindowCoveringUpOrOpen : public ModelCommand
{
public:
    WindowCoveringUpOrOpen() : ModelCommand("up-or-open") { ModelCommand::AddArguments(); }
    ~WindowCoveringUpOrOpen()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.UpOrOpen(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Discover Attributes
 */
class DiscoverWindowCoveringAttributes : public ModelCommand
{
public:
    DiscoverWindowCoveringAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverWindowCoveringAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Type
 */
class ReadWindowCoveringType : public ModelCommand
{
public:
    ReadWindowCoveringType() : ModelCommand("read")
    {
        AddArgument("attr-name", "type");
        ModelCommand::AddArguments();
    }

    ~ReadWindowCoveringType()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeType(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CurrentPositionLift
 */
class ReadWindowCoveringCurrentPositionLift : public ModelCommand
{
public:
    ReadWindowCoveringCurrentPositionLift() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-position-lift");
        ModelCommand::AddArguments();
    }

    ~ReadWindowCoveringCurrentPositionLift()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentPositionLift(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CurrentPositionTilt
 */
class ReadWindowCoveringCurrentPositionTilt : public ModelCommand
{
public:
    ReadWindowCoveringCurrentPositionTilt() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-position-tilt");
        ModelCommand::AddArguments();
    }

    ~ReadWindowCoveringCurrentPositionTilt()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentPositionTilt(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ConfigStatus
 */
class ReadWindowCoveringConfigStatus : public ModelCommand
{
public:
    ReadWindowCoveringConfigStatus() : ModelCommand("read")
    {
        AddArgument("attr-name", "config-status");
        ModelCommand::AddArguments();
    }

    ~ReadWindowCoveringConfigStatus()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeConfigStatus(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CurrentPositionLiftPercentage
 */
class ReadWindowCoveringCurrentPositionLiftPercentage : public ModelCommand
{
public:
    ReadWindowCoveringCurrentPositionLiftPercentage() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-position-lift-percentage");
        ModelCommand::AddArguments();
    }

    ~ReadWindowCoveringCurrentPositionLiftPercentage()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentPositionLiftPercentage(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportWindowCoveringCurrentPositionLiftPercentage : public ModelCommand
{
public:
    ReportWindowCoveringCurrentPositionLiftPercentage() : ModelCommand("report")
    {
        AddArgument("attr-name", "current-position-lift-percentage");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", 0, UINT8_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportWindowCoveringCurrentPositionLiftPercentage()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeCurrentPositionLiftPercentage(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeCurrentPositionLiftPercentage(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                                                       mMinInterval, mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int8uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    uint8_t mChange;
};

/*
 * Attribute CurrentPositionTiltPercentage
 */
class ReadWindowCoveringCurrentPositionTiltPercentage : public ModelCommand
{
public:
    ReadWindowCoveringCurrentPositionTiltPercentage() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-position-tilt-percentage");
        ModelCommand::AddArguments();
    }

    ~ReadWindowCoveringCurrentPositionTiltPercentage()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentPositionTiltPercentage(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportWindowCoveringCurrentPositionTiltPercentage : public ModelCommand
{
public:
    ReportWindowCoveringCurrentPositionTiltPercentage() : ModelCommand("report")
    {
        AddArgument("attr-name", "current-position-tilt-percentage");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", 0, UINT8_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportWindowCoveringCurrentPositionTiltPercentage()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeCurrentPositionTiltPercentage(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeCurrentPositionTiltPercentage(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                                                       mMinInterval, mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int8uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    uint8_t mChange;
};

/*
 * Attribute OperationalStatus
 */
class ReadWindowCoveringOperationalStatus : public ModelCommand
{
public:
    ReadWindowCoveringOperationalStatus() : ModelCommand("read")
    {
        AddArgument("attr-name", "operational-status");
        ModelCommand::AddArguments();
    }

    ~ReadWindowCoveringOperationalStatus()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeOperationalStatus(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportWindowCoveringOperationalStatus : public ModelCommand
{
public:
    ReportWindowCoveringOperationalStatus() : ModelCommand("report")
    {
        AddArgument("attr-name", "operational-status");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        ModelCommand::AddArguments();
    }

    ~ReportWindowCoveringOperationalStatus()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeOperationalStatus(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeOperationalStatus(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                           mMaxInterval);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int8uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
};

/*
 * Attribute TargetPositionLiftPercent100ths
 */
class ReadWindowCoveringTargetPositionLiftPercent100ths : public ModelCommand
{
public:
    ReadWindowCoveringTargetPositionLiftPercent100ths() : ModelCommand("read")
    {
        AddArgument("attr-name", "target-position-lift-percent100ths");
        ModelCommand::AddArguments();
    }

    ~ReadWindowCoveringTargetPositionLiftPercent100ths()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTargetPositionLiftPercent100ths(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportWindowCoveringTargetPositionLiftPercent100ths : public ModelCommand
{
public:
    ReportWindowCoveringTargetPositionLiftPercent100ths() : ModelCommand("report")
    {
        AddArgument("attr-name", "target-position-lift-percent100ths");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", 0, UINT16_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportWindowCoveringTargetPositionLiftPercent100ths()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeTargetPositionLiftPercent100ths(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeTargetPositionLiftPercent100ths(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                                                         mMinInterval, mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int16uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    uint16_t mChange;
};

/*
 * Attribute TargetPositionTiltPercent100ths
 */
class ReadWindowCoveringTargetPositionTiltPercent100ths : public ModelCommand
{
public:
    ReadWindowCoveringTargetPositionTiltPercent100ths() : ModelCommand("read")
    {
        AddArgument("attr-name", "target-position-tilt-percent100ths");
        ModelCommand::AddArguments();
    }

    ~ReadWindowCoveringTargetPositionTiltPercent100ths()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTargetPositionTiltPercent100ths(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportWindowCoveringTargetPositionTiltPercent100ths : public ModelCommand
{
public:
    ReportWindowCoveringTargetPositionTiltPercent100ths() : ModelCommand("report")
    {
        AddArgument("attr-name", "target-position-tilt-percent100ths");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", 0, UINT16_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportWindowCoveringTargetPositionTiltPercent100ths()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeTargetPositionTiltPercent100ths(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeTargetPositionTiltPercent100ths(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                                                         mMinInterval, mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int16uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    uint16_t mChange;
};

/*
 * Attribute EndProductType
 */
class ReadWindowCoveringEndProductType : public ModelCommand
{
public:
    ReadWindowCoveringEndProductType() : ModelCommand("read")
    {
        AddArgument("attr-name", "end-product-type");
        ModelCommand::AddArguments();
    }

    ~ReadWindowCoveringEndProductType()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeEndProductType(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CurrentPositionLiftPercent100ths
 */
class ReadWindowCoveringCurrentPositionLiftPercent100ths : public ModelCommand
{
public:
    ReadWindowCoveringCurrentPositionLiftPercent100ths() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-position-lift-percent100ths");
        ModelCommand::AddArguments();
    }

    ~ReadWindowCoveringCurrentPositionLiftPercent100ths()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentPositionLiftPercent100ths(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportWindowCoveringCurrentPositionLiftPercent100ths : public ModelCommand
{
public:
    ReportWindowCoveringCurrentPositionLiftPercent100ths() : ModelCommand("report")
    {
        AddArgument("attr-name", "current-position-lift-percent100ths");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", 0, UINT16_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportWindowCoveringCurrentPositionLiftPercent100ths()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeCurrentPositionLiftPercent100ths(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeCurrentPositionLiftPercent100ths(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                                                          mMinInterval, mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int16uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    uint16_t mChange;
};

/*
 * Attribute CurrentPositionTiltPercent100ths
 */
class ReadWindowCoveringCurrentPositionTiltPercent100ths : public ModelCommand
{
public:
    ReadWindowCoveringCurrentPositionTiltPercent100ths() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-position-tilt-percent100ths");
        ModelCommand::AddArguments();
    }

    ~ReadWindowCoveringCurrentPositionTiltPercent100ths()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentPositionTiltPercent100ths(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportWindowCoveringCurrentPositionTiltPercent100ths : public ModelCommand
{
public:
    ReportWindowCoveringCurrentPositionTiltPercent100ths() : ModelCommand("report")
    {
        AddArgument("attr-name", "current-position-tilt-percent100ths");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", 0, UINT16_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportWindowCoveringCurrentPositionTiltPercent100ths()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeCurrentPositionTiltPercent100ths(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeCurrentPositionTiltPercent100ths(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                                                          mMinInterval, mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int16uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    uint16_t mChange;
};

/*
 * Attribute InstalledOpenLimitLift
 */
class ReadWindowCoveringInstalledOpenLimitLift : public ModelCommand
{
public:
    ReadWindowCoveringInstalledOpenLimitLift() : ModelCommand("read")
    {
        AddArgument("attr-name", "installed-open-limit-lift");
        ModelCommand::AddArguments();
    }

    ~ReadWindowCoveringInstalledOpenLimitLift()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeInstalledOpenLimitLift(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute InstalledClosedLimitLift
 */
class ReadWindowCoveringInstalledClosedLimitLift : public ModelCommand
{
public:
    ReadWindowCoveringInstalledClosedLimitLift() : ModelCommand("read")
    {
        AddArgument("attr-name", "installed-closed-limit-lift");
        ModelCommand::AddArguments();
    }

    ~ReadWindowCoveringInstalledClosedLimitLift()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeInstalledClosedLimitLift(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute InstalledOpenLimitTilt
 */
class ReadWindowCoveringInstalledOpenLimitTilt : public ModelCommand
{
public:
    ReadWindowCoveringInstalledOpenLimitTilt() : ModelCommand("read")
    {
        AddArgument("attr-name", "installed-open-limit-tilt");
        ModelCommand::AddArguments();
    }

    ~ReadWindowCoveringInstalledOpenLimitTilt()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeInstalledOpenLimitTilt(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute InstalledClosedLimitTilt
 */
class ReadWindowCoveringInstalledClosedLimitTilt : public ModelCommand
{
public:
    ReadWindowCoveringInstalledClosedLimitTilt() : ModelCommand("read")
    {
        AddArgument("attr-name", "installed-closed-limit-tilt");
        ModelCommand::AddArguments();
    }

    ~ReadWindowCoveringInstalledClosedLimitTilt()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeInstalledClosedLimitTilt(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Mode
 */
class ReadWindowCoveringMode : public ModelCommand
{
public:
    ReadWindowCoveringMode() : ModelCommand("read")
    {
        AddArgument("attr-name", "mode");
        ModelCommand::AddArguments();
    }

    ~ReadWindowCoveringMode()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteWindowCoveringMode : public ModelCommand
{
public:
    WriteWindowCoveringMode() : ModelCommand("write")
    {
        AddArgument("attr-name", "mode");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteWindowCoveringMode()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x01) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute SafetyStatus
 */
class ReadWindowCoveringSafetyStatus : public ModelCommand
{
public:
    ReadWindowCoveringSafetyStatus() : ModelCommand("read")
    {
        AddArgument("attr-name", "safety-status");
        ModelCommand::AddArguments();
    }

    ~ReadWindowCoveringSafetyStatus()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeSafetyStatus(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportWindowCoveringSafetyStatus : public ModelCommand
{
public:
    ReportWindowCoveringSafetyStatus() : ModelCommand("report")
    {
        AddArgument("attr-name", "safety-status");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        ModelCommand::AddArguments();
    }

    ~ReportWindowCoveringSafetyStatus()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x06) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeSafetyStatus(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeSafetyStatus(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                      mMaxInterval);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int16uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
};

/*
 * Attribute ClusterRevision
 */
class ReadWindowCoveringClusterRevision : public ModelCommand
{
public:
    ReadWindowCoveringClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadWindowCoveringClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0102) command (0x00) on endpoint %" PRIu8, endpointId);

        chip::Controller::WindowCoveringCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Register all Clusters commands                                               |
\*----------------------------------------------------------------------------*/
void registerClusterAccountLogin(Commands & commands)
{
    const char * clusterName = "AccountLogin";

    commands_list clusterCommands = {
        make_unique<AccountLoginGetSetupPIN>(),
        make_unique<AccountLoginLogin>(),
        make_unique<DiscoverAccountLoginAttributes>(),
        make_unique<ReadAccountLoginClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterApplicationBasic(Commands & commands)
{
    const char * clusterName = "ApplicationBasic";

    commands_list clusterCommands = {
        make_unique<ApplicationBasicChangeStatus>(),          make_unique<DiscoverApplicationBasicAttributes>(),
        make_unique<ReadApplicationBasicVendorName>(),        make_unique<ReadApplicationBasicVendorId>(),
        make_unique<ReadApplicationBasicApplicationName>(),   make_unique<ReadApplicationBasicProductId>(),
        make_unique<ReadApplicationBasicApplicationId>(),     make_unique<ReadApplicationBasicCatalogVendorId>(),
        make_unique<ReadApplicationBasicApplicationStatus>(), make_unique<ReadApplicationBasicClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterApplicationLauncher(Commands & commands)
{
    const char * clusterName = "ApplicationLauncher";

    commands_list clusterCommands = {
        make_unique<ApplicationLauncherLaunchApp>(),
        make_unique<DiscoverApplicationLauncherAttributes>(),
        make_unique<ReadApplicationLauncherApplicationLauncherList>(),
        make_unique<ReadApplicationLauncherCatalogVendorId>(),
        make_unique<ReadApplicationLauncherApplicationId>(),
        make_unique<ReadApplicationLauncherClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterAudioOutput(Commands & commands)
{
    const char * clusterName = "AudioOutput";

    commands_list clusterCommands = {
        make_unique<AudioOutputRenameOutput>(),           make_unique<AudioOutputSelectOutput>(),
        make_unique<DiscoverAudioOutputAttributes>(),     make_unique<ReadAudioOutputAudioOutputList>(),
        make_unique<ReadAudioOutputCurrentAudioOutput>(), make_unique<ReadAudioOutputClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterBarrierControl(Commands & commands)
{
    const char * clusterName = "BarrierControl";

    commands_list clusterCommands = {
        make_unique<BarrierControlBarrierControlGoToPercent>(), make_unique<BarrierControlBarrierControlStop>(),
        make_unique<DiscoverBarrierControlAttributes>(),        make_unique<ReadBarrierControlBarrierMovingState>(),
        make_unique<ReadBarrierControlBarrierSafetyStatus>(),   make_unique<ReadBarrierControlBarrierCapabilities>(),
        make_unique<ReadBarrierControlBarrierPosition>(),       make_unique<ReadBarrierControlClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterBasic(Commands & commands)
{
    const char * clusterName = "Basic";

    commands_list clusterCommands = {
        make_unique<BasicMfgSpecificPing>(),
        make_unique<DiscoverBasicAttributes>(),
        make_unique<ReadBasicInteractionModelVersion>(),
        make_unique<ReadBasicVendorName>(),
        make_unique<ReadBasicVendorID>(),
        make_unique<ReadBasicProductName>(),
        make_unique<ReadBasicProductID>(),
        make_unique<ReadBasicUserLabel>(),
        make_unique<WriteBasicUserLabel>(),
        make_unique<ReadBasicLocation>(),
        make_unique<WriteBasicLocation>(),
        make_unique<ReadBasicHardwareVersion>(),
        make_unique<ReadBasicHardwareVersionString>(),
        make_unique<ReadBasicSoftwareVersion>(),
        make_unique<ReadBasicSoftwareVersionString>(),
        make_unique<ReadBasicManufacturingDate>(),
        make_unique<ReadBasicPartNumber>(),
        make_unique<ReadBasicProductURL>(),
        make_unique<ReadBasicProductLabel>(),
        make_unique<ReadBasicSerialNumber>(),
        make_unique<ReadBasicLocalConfigDisabled>(),
        make_unique<WriteBasicLocalConfigDisabled>(),
        make_unique<ReadBasicReachable>(),
        make_unique<ReadBasicClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterBinaryInputBasic(Commands & commands)
{
    const char * clusterName = "BinaryInputBasic";

    commands_list clusterCommands = {
        make_unique<DiscoverBinaryInputBasicAttributes>(),  make_unique<ReadBinaryInputBasicOutOfService>(),
        make_unique<WriteBinaryInputBasicOutOfService>(),   make_unique<ReadBinaryInputBasicPresentValue>(),
        make_unique<WriteBinaryInputBasicPresentValue>(),   make_unique<ReportBinaryInputBasicPresentValue>(),
        make_unique<ReadBinaryInputBasicStatusFlags>(),     make_unique<ReportBinaryInputBasicStatusFlags>(),
        make_unique<ReadBinaryInputBasicClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterBinding(Commands & commands)
{
    const char * clusterName = "Binding";

    commands_list clusterCommands = {
        make_unique<BindingBind>(),
        make_unique<BindingUnbind>(),
        make_unique<DiscoverBindingAttributes>(),
        make_unique<ReadBindingClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterBridgedDeviceBasic(Commands & commands)
{
    const char * clusterName = "BridgedDeviceBasic";

    commands_list clusterCommands = {
        make_unique<DiscoverBridgedDeviceBasicAttributes>(),    make_unique<ReadBridgedDeviceBasicVendorName>(),
        make_unique<ReadBridgedDeviceBasicVendorID>(),          make_unique<ReadBridgedDeviceBasicProductName>(),
        make_unique<ReadBridgedDeviceBasicUserLabel>(),         make_unique<WriteBridgedDeviceBasicUserLabel>(),
        make_unique<ReadBridgedDeviceBasicHardwareVersion>(),   make_unique<ReadBridgedDeviceBasicHardwareVersionString>(),
        make_unique<ReadBridgedDeviceBasicSoftwareVersion>(),   make_unique<ReadBridgedDeviceBasicSoftwareVersionString>(),
        make_unique<ReadBridgedDeviceBasicManufacturingDate>(), make_unique<ReadBridgedDeviceBasicPartNumber>(),
        make_unique<ReadBridgedDeviceBasicProductURL>(),        make_unique<ReadBridgedDeviceBasicProductLabel>(),
        make_unique<ReadBridgedDeviceBasicSerialNumber>(),      make_unique<ReadBridgedDeviceBasicReachable>(),
        make_unique<ReadBridgedDeviceBasicClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterColorControl(Commands & commands)
{
    const char * clusterName = "ColorControl";

    commands_list clusterCommands = {
        make_unique<ColorControlColorLoopSet>(),
        make_unique<ColorControlEnhancedMoveHue>(),
        make_unique<ColorControlEnhancedMoveToHue>(),
        make_unique<ColorControlEnhancedMoveToHueAndSaturation>(),
        make_unique<ColorControlEnhancedStepHue>(),
        make_unique<ColorControlMoveColor>(),
        make_unique<ColorControlMoveColorTemperature>(),
        make_unique<ColorControlMoveHue>(),
        make_unique<ColorControlMoveSaturation>(),
        make_unique<ColorControlMoveToColor>(),
        make_unique<ColorControlMoveToColorTemperature>(),
        make_unique<ColorControlMoveToHue>(),
        make_unique<ColorControlMoveToHueAndSaturation>(),
        make_unique<ColorControlMoveToSaturation>(),
        make_unique<ColorControlStepColor>(),
        make_unique<ColorControlStepColorTemperature>(),
        make_unique<ColorControlStepHue>(),
        make_unique<ColorControlStepSaturation>(),
        make_unique<ColorControlStopMoveStep>(),
        make_unique<DiscoverColorControlAttributes>(),
        make_unique<ReadColorControlCurrentHue>(),
        make_unique<ReportColorControlCurrentHue>(),
        make_unique<ReadColorControlCurrentSaturation>(),
        make_unique<ReportColorControlCurrentSaturation>(),
        make_unique<ReadColorControlRemainingTime>(),
        make_unique<ReadColorControlCurrentX>(),
        make_unique<ReportColorControlCurrentX>(),
        make_unique<ReadColorControlCurrentY>(),
        make_unique<ReportColorControlCurrentY>(),
        make_unique<ReadColorControlDriftCompensation>(),
        make_unique<ReadColorControlCompensationText>(),
        make_unique<ReadColorControlColorTemperature>(),
        make_unique<ReportColorControlColorTemperature>(),
        make_unique<ReadColorControlColorMode>(),
        make_unique<ReadColorControlColorControlOptions>(),
        make_unique<WriteColorControlColorControlOptions>(),
        make_unique<ReadColorControlNumberOfPrimaries>(),
        make_unique<ReadColorControlPrimary1X>(),
        make_unique<ReadColorControlPrimary1Y>(),
        make_unique<ReadColorControlPrimary1Intensity>(),
        make_unique<ReadColorControlPrimary2X>(),
        make_unique<ReadColorControlPrimary2Y>(),
        make_unique<ReadColorControlPrimary2Intensity>(),
        make_unique<ReadColorControlPrimary3X>(),
        make_unique<ReadColorControlPrimary3Y>(),
        make_unique<ReadColorControlPrimary3Intensity>(),
        make_unique<ReadColorControlPrimary4X>(),
        make_unique<ReadColorControlPrimary4Y>(),
        make_unique<ReadColorControlPrimary4Intensity>(),
        make_unique<ReadColorControlPrimary5X>(),
        make_unique<ReadColorControlPrimary5Y>(),
        make_unique<ReadColorControlPrimary5Intensity>(),
        make_unique<ReadColorControlPrimary6X>(),
        make_unique<ReadColorControlPrimary6Y>(),
        make_unique<ReadColorControlPrimary6Intensity>(),
        make_unique<ReadColorControlWhitePointX>(),
        make_unique<WriteColorControlWhitePointX>(),
        make_unique<ReadColorControlWhitePointY>(),
        make_unique<WriteColorControlWhitePointY>(),
        make_unique<ReadColorControlColorPointRX>(),
        make_unique<WriteColorControlColorPointRX>(),
        make_unique<ReadColorControlColorPointRY>(),
        make_unique<WriteColorControlColorPointRY>(),
        make_unique<ReadColorControlColorPointRIntensity>(),
        make_unique<WriteColorControlColorPointRIntensity>(),
        make_unique<ReadColorControlColorPointGX>(),
        make_unique<WriteColorControlColorPointGX>(),
        make_unique<ReadColorControlColorPointGY>(),
        make_unique<WriteColorControlColorPointGY>(),
        make_unique<ReadColorControlColorPointGIntensity>(),
        make_unique<WriteColorControlColorPointGIntensity>(),
        make_unique<ReadColorControlColorPointBX>(),
        make_unique<WriteColorControlColorPointBX>(),
        make_unique<ReadColorControlColorPointBY>(),
        make_unique<WriteColorControlColorPointBY>(),
        make_unique<ReadColorControlColorPointBIntensity>(),
        make_unique<WriteColorControlColorPointBIntensity>(),
        make_unique<ReadColorControlEnhancedCurrentHue>(),
        make_unique<ReadColorControlEnhancedColorMode>(),
        make_unique<ReadColorControlColorLoopActive>(),
        make_unique<ReadColorControlColorLoopDirection>(),
        make_unique<ReadColorControlColorLoopTime>(),
        make_unique<ReadColorControlColorCapabilities>(),
        make_unique<ReadColorControlColorTempPhysicalMin>(),
        make_unique<ReadColorControlColorTempPhysicalMax>(),
        make_unique<ReadColorControlCoupleColorTempToLevelMinMireds>(),
        make_unique<ReadColorControlStartUpColorTemperatureMireds>(),
        make_unique<WriteColorControlStartUpColorTemperatureMireds>(),
        make_unique<ReadColorControlClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterContentLauncher(Commands & commands)
{
    const char * clusterName = "ContentLauncher";

    commands_list clusterCommands = {
        make_unique<ContentLauncherLaunchContent>(),
        make_unique<ContentLauncherLaunchURL>(),
        make_unique<DiscoverContentLauncherAttributes>(),
        make_unique<ReadContentLauncherAcceptsHeaderList>(),
        make_unique<ReadContentLauncherSupportedStreamingTypes>(),
        make_unique<ReadContentLauncherClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterDescriptor(Commands & commands)
{
    const char * clusterName = "Descriptor";

    commands_list clusterCommands = {
        make_unique<DiscoverDescriptorAttributes>(), make_unique<ReadDescriptorDeviceList>(),
        make_unique<ReadDescriptorServerList>(),     make_unique<ReadDescriptorClientList>(),
        make_unique<ReadDescriptorPartsList>(),      make_unique<ReadDescriptorClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterDiagnosticLogs(Commands & commands)
{
    const char * clusterName = "DiagnosticLogs";

    commands_list clusterCommands = {
        make_unique<DiagnosticLogsRetrieveLogsRequest>(),
        make_unique<DiscoverDiagnosticLogsAttributes>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterDoorLock(Commands & commands)
{
    const char * clusterName = "DoorLock";

    commands_list clusterCommands = {
        make_unique<DoorLockClearAllPins>(),
        make_unique<DoorLockClearAllRfids>(),
        make_unique<DoorLockClearHolidaySchedule>(),
        make_unique<DoorLockClearPin>(),
        make_unique<DoorLockClearRfid>(),
        make_unique<DoorLockClearWeekdaySchedule>(),
        make_unique<DoorLockClearYeardaySchedule>(),
        make_unique<DoorLockGetHolidaySchedule>(),
        make_unique<DoorLockGetLogRecord>(),
        make_unique<DoorLockGetPin>(),
        make_unique<DoorLockGetRfid>(),
        make_unique<DoorLockGetUserType>(),
        make_unique<DoorLockGetWeekdaySchedule>(),
        make_unique<DoorLockGetYeardaySchedule>(),
        make_unique<DoorLockLockDoor>(),
        make_unique<DoorLockSetHolidaySchedule>(),
        make_unique<DoorLockSetPin>(),
        make_unique<DoorLockSetRfid>(),
        make_unique<DoorLockSetUserType>(),
        make_unique<DoorLockSetWeekdaySchedule>(),
        make_unique<DoorLockSetYeardaySchedule>(),
        make_unique<DoorLockUnlockDoor>(),
        make_unique<DoorLockUnlockWithTimeout>(),
        make_unique<DiscoverDoorLockAttributes>(),
        make_unique<ReadDoorLockLockState>(),
        make_unique<ReportDoorLockLockState>(),
        make_unique<ReadDoorLockLockType>(),
        make_unique<ReadDoorLockActuatorEnabled>(),
        make_unique<ReadDoorLockClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterElectricalMeasurement(Commands & commands)
{
    const char * clusterName = "ElectricalMeasurement";

    commands_list clusterCommands = {
        make_unique<DiscoverElectricalMeasurementAttributes>(),   make_unique<ReadElectricalMeasurementMeasurementType>(),
        make_unique<ReadElectricalMeasurementTotalActivePower>(), make_unique<ReadElectricalMeasurementRmsVoltage>(),
        make_unique<ReadElectricalMeasurementRmsVoltageMin>(),    make_unique<ReadElectricalMeasurementRmsVoltageMax>(),
        make_unique<ReadElectricalMeasurementRmsCurrent>(),       make_unique<ReadElectricalMeasurementRmsCurrentMin>(),
        make_unique<ReadElectricalMeasurementRmsCurrentMax>(),    make_unique<ReadElectricalMeasurementActivePower>(),
        make_unique<ReadElectricalMeasurementActivePowerMin>(),   make_unique<ReadElectricalMeasurementActivePowerMax>(),
        make_unique<ReadElectricalMeasurementClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterEthernetNetworkDiagnostics(Commands & commands)
{
    const char * clusterName = "EthernetNetworkDiagnostics";

    commands_list clusterCommands = {
        make_unique<EthernetNetworkDiagnosticsResetCounts>(),       make_unique<DiscoverEthernetNetworkDiagnosticsAttributes>(),
        make_unique<ReadEthernetNetworkDiagnosticsPacketRxCount>(), make_unique<ReadEthernetNetworkDiagnosticsPacketTxCount>(),
        make_unique<ReadEthernetNetworkDiagnosticsTxErrCount>(),    make_unique<ReadEthernetNetworkDiagnosticsCollisionCount>(),
        make_unique<ReadEthernetNetworkDiagnosticsOverrunCount>(),  make_unique<ReadEthernetNetworkDiagnosticsClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterFixedLabel(Commands & commands)
{
    const char * clusterName = "FixedLabel";

    commands_list clusterCommands = {
        make_unique<DiscoverFixedLabelAttributes>(),
        make_unique<ReadFixedLabelLabelList>(),
        make_unique<ReadFixedLabelClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterFlowMeasurement(Commands & commands)
{
    const char * clusterName = "FlowMeasurement";

    commands_list clusterCommands = {
        make_unique<DiscoverFlowMeasurementAttributes>(),   make_unique<ReadFlowMeasurementMeasuredValue>(),
        make_unique<ReadFlowMeasurementMinMeasuredValue>(), make_unique<ReadFlowMeasurementMaxMeasuredValue>(),
        make_unique<ReadFlowMeasurementClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterGeneralCommissioning(Commands & commands)
{
    const char * clusterName = "GeneralCommissioning";

    commands_list clusterCommands = {
        make_unique<GeneralCommissioningArmFailSafe>(),         make_unique<GeneralCommissioningCommissioningComplete>(),
        make_unique<GeneralCommissioningSetRegulatoryConfig>(), make_unique<DiscoverGeneralCommissioningAttributes>(),
        make_unique<ReadGeneralCommissioningFabricId>(),        make_unique<ReadGeneralCommissioningBreadcrumb>(),
        make_unique<WriteGeneralCommissioningBreadcrumb>(),     make_unique<ReadGeneralCommissioningClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterGeneralDiagnostics(Commands & commands)
{
    const char * clusterName = "GeneralDiagnostics";

    commands_list clusterCommands = {
        make_unique<DiscoverGeneralDiagnosticsAttributes>(),
        make_unique<ReadGeneralDiagnosticsNetworkInterfaces>(),
        make_unique<ReadGeneralDiagnosticsRebootCount>(),
        make_unique<ReadGeneralDiagnosticsClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterGroupKeyManagement(Commands & commands)
{
    const char * clusterName = "GroupKeyManagement";

    commands_list clusterCommands = {
        make_unique<DiscoverGroupKeyManagementAttributes>(),
        make_unique<ReadGroupKeyManagementGroups>(),
        make_unique<ReadGroupKeyManagementGroupKeys>(),
        make_unique<ReadGroupKeyManagementClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterGroups(Commands & commands)
{
    const char * clusterName = "Groups";

    commands_list clusterCommands = {
        make_unique<GroupsAddGroup>(),
        make_unique<GroupsAddGroupIfIdentifying>(),
        make_unique<GroupsGetGroupMembership>(),
        make_unique<GroupsRemoveAllGroups>(),
        make_unique<GroupsRemoveGroup>(),
        make_unique<GroupsViewGroup>(),
        make_unique<DiscoverGroupsAttributes>(),
        make_unique<ReadGroupsNameSupport>(),
        make_unique<ReadGroupsClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterIdentify(Commands & commands)
{
    const char * clusterName = "Identify";

    commands_list clusterCommands = {
        make_unique<IdentifyIdentify>(),           make_unique<IdentifyIdentifyQuery>(),
        make_unique<DiscoverIdentifyAttributes>(), make_unique<ReadIdentifyIdentifyTime>(),
        make_unique<WriteIdentifyIdentifyTime>(),  make_unique<ReadIdentifyClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterKeypadInput(Commands & commands)
{
    const char * clusterName = "KeypadInput";

    commands_list clusterCommands = {
        make_unique<KeypadInputSendKey>(),
        make_unique<DiscoverKeypadInputAttributes>(),
        make_unique<ReadKeypadInputClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterLevelControl(Commands & commands)
{
    const char * clusterName = "LevelControl";

    commands_list clusterCommands = {
        make_unique<LevelControlMove>(),
        make_unique<LevelControlMoveToLevel>(),
        make_unique<LevelControlMoveToLevelWithOnOff>(),
        make_unique<LevelControlMoveWithOnOff>(),
        make_unique<LevelControlStep>(),
        make_unique<LevelControlStepWithOnOff>(),
        make_unique<LevelControlStop>(),
        make_unique<LevelControlStopWithOnOff>(),
        make_unique<DiscoverLevelControlAttributes>(),
        make_unique<ReadLevelControlCurrentLevel>(),
        make_unique<ReportLevelControlCurrentLevel>(),
        make_unique<ReadLevelControlClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterLowPower(Commands & commands)
{
    const char * clusterName = "LowPower";

    commands_list clusterCommands = {
        make_unique<LowPowerSleep>(),
        make_unique<DiscoverLowPowerAttributes>(),
        make_unique<ReadLowPowerClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterMediaInput(Commands & commands)
{
    const char * clusterName = "MediaInput";

    commands_list clusterCommands = {
        make_unique<MediaInputHideInputStatus>(),       make_unique<MediaInputRenameInput>(),
        make_unique<MediaInputSelectInput>(),           make_unique<MediaInputShowInputStatus>(),
        make_unique<DiscoverMediaInputAttributes>(),    make_unique<ReadMediaInputMediaInputList>(),
        make_unique<ReadMediaInputCurrentMediaInput>(), make_unique<ReadMediaInputClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterMediaPlayback(Commands & commands)
{
    const char * clusterName = "MediaPlayback";

    commands_list clusterCommands = {
        make_unique<MediaPlaybackMediaFastForward>(),    make_unique<MediaPlaybackMediaNext>(),
        make_unique<MediaPlaybackMediaPause>(),          make_unique<MediaPlaybackMediaPlay>(),
        make_unique<MediaPlaybackMediaPrevious>(),       make_unique<MediaPlaybackMediaRewind>(),
        make_unique<MediaPlaybackMediaSeek>(),           make_unique<MediaPlaybackMediaSkipBackward>(),
        make_unique<MediaPlaybackMediaSkipForward>(),    make_unique<MediaPlaybackMediaStartOver>(),
        make_unique<MediaPlaybackMediaStop>(),           make_unique<DiscoverMediaPlaybackAttributes>(),
        make_unique<ReadMediaPlaybackClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterNetworkCommissioning(Commands & commands)
{
    const char * clusterName = "NetworkCommissioning";

    commands_list clusterCommands = {
        make_unique<NetworkCommissioningAddThreadNetwork>(),
        make_unique<NetworkCommissioningAddWiFiNetwork>(),
        make_unique<NetworkCommissioningDisableNetwork>(),
        make_unique<NetworkCommissioningEnableNetwork>(),
        make_unique<NetworkCommissioningGetLastNetworkCommissioningResult>(),
        make_unique<NetworkCommissioningRemoveNetwork>(),
        make_unique<NetworkCommissioningScanNetworks>(),
        make_unique<NetworkCommissioningUpdateThreadNetwork>(),
        make_unique<NetworkCommissioningUpdateWiFiNetwork>(),
        make_unique<DiscoverNetworkCommissioningAttributes>(),
        make_unique<ReadNetworkCommissioningClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterOtaSoftwareUpdateProvider(Commands & commands)
{
    const char * clusterName = "OtaSoftwareUpdateProvider";

    commands_list clusterCommands = {
        make_unique<OtaSoftwareUpdateProviderApplyUpdateRequest>(),  make_unique<OtaSoftwareUpdateProviderNotifyUpdateApplied>(),
        make_unique<OtaSoftwareUpdateProviderQueryImage>(),          make_unique<DiscoverOtaSoftwareUpdateProviderAttributes>(),
        make_unique<ReadOtaSoftwareUpdateProviderClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterOccupancySensing(Commands & commands)
{
    const char * clusterName = "OccupancySensing";

    commands_list clusterCommands = {
        make_unique<DiscoverOccupancySensingAttributes>(),
        make_unique<ReadOccupancySensingOccupancy>(),
        make_unique<ReportOccupancySensingOccupancy>(),
        make_unique<ReadOccupancySensingOccupancySensorType>(),
        make_unique<ReadOccupancySensingOccupancySensorTypeBitmap>(),
        make_unique<ReadOccupancySensingClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterOnOff(Commands & commands)
{
    const char * clusterName = "OnOff";

    commands_list clusterCommands = {
        make_unique<OnOffOff>(),
        make_unique<OnOffOffWithEffect>(),
        make_unique<OnOffOn>(),
        make_unique<OnOffOnWithRecallGlobalScene>(),
        make_unique<OnOffOnWithTimedOff>(),
        make_unique<OnOffToggle>(),
        make_unique<DiscoverOnOffAttributes>(),
        make_unique<ReadOnOffOnOff>(),
        make_unique<ReportOnOffOnOff>(),
        make_unique<ReadOnOffGlobalSceneControl>(),
        make_unique<ReadOnOffOnTime>(),
        make_unique<WriteOnOffOnTime>(),
        make_unique<ReadOnOffOffWaitTime>(),
        make_unique<WriteOnOffOffWaitTime>(),
        make_unique<ReadOnOffStartUpOnOff>(),
        make_unique<WriteOnOffStartUpOnOff>(),
        make_unique<ReadOnOffFeatureMap>(),
        make_unique<ReadOnOffClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterOperationalCredentials(Commands & commands)
{
    const char * clusterName = "OperationalCredentials";

    commands_list clusterCommands = {
        make_unique<OperationalCredentialsAddOpCert>(),           make_unique<OperationalCredentialsAddTrustedRootCertificate>(),
        make_unique<OperationalCredentialsOpCSRRequest>(),        make_unique<OperationalCredentialsRemoveAllFabrics>(),
        make_unique<OperationalCredentialsRemoveFabric>(),        make_unique<OperationalCredentialsRemoveTrustedRootCertificate>(),
        make_unique<OperationalCredentialsSetFabric>(),           make_unique<OperationalCredentialsUpdateFabricLabel>(),
        make_unique<DiscoverOperationalCredentialsAttributes>(),  make_unique<ReadOperationalCredentialsFabricsList>(),
        make_unique<ReadOperationalCredentialsClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterPressureMeasurement(Commands & commands)
{
    const char * clusterName = "PressureMeasurement";

    commands_list clusterCommands = {
        make_unique<DiscoverPressureMeasurementAttributes>(),   make_unique<ReadPressureMeasurementMeasuredValue>(),
        make_unique<ReportPressureMeasurementMeasuredValue>(),  make_unique<ReadPressureMeasurementMinMeasuredValue>(),
        make_unique<ReadPressureMeasurementMaxMeasuredValue>(), make_unique<ReadPressureMeasurementClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterPumpConfigurationAndControl(Commands & commands)
{
    const char * clusterName = "PumpConfigurationAndControl";

    commands_list clusterCommands = {
        make_unique<DiscoverPumpConfigurationAndControlAttributes>(),
        make_unique<ReadPumpConfigurationAndControlMaxPressure>(),
        make_unique<ReadPumpConfigurationAndControlMaxSpeed>(),
        make_unique<ReadPumpConfigurationAndControlMaxFlow>(),
        make_unique<ReadPumpConfigurationAndControlEffectiveOperationMode>(),
        make_unique<ReadPumpConfigurationAndControlEffectiveControlMode>(),
        make_unique<ReadPumpConfigurationAndControlCapacity>(),
        make_unique<ReportPumpConfigurationAndControlCapacity>(),
        make_unique<ReadPumpConfigurationAndControlOperationMode>(),
        make_unique<WritePumpConfigurationAndControlOperationMode>(),
        make_unique<ReadPumpConfigurationAndControlClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterRelativeHumidityMeasurement(Commands & commands)
{
    const char * clusterName = "RelativeHumidityMeasurement";

    commands_list clusterCommands = {
        make_unique<DiscoverRelativeHumidityMeasurementAttributes>(),
        make_unique<ReadRelativeHumidityMeasurementMeasuredValue>(),
        make_unique<ReportRelativeHumidityMeasurementMeasuredValue>(),
        make_unique<ReadRelativeHumidityMeasurementMinMeasuredValue>(),
        make_unique<ReadRelativeHumidityMeasurementMaxMeasuredValue>(),
        make_unique<ReadRelativeHumidityMeasurementClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterScenes(Commands & commands)
{
    const char * clusterName = "Scenes";

    commands_list clusterCommands = {
        make_unique<ScenesAddScene>(),         make_unique<ScenesGetSceneMembership>(),  make_unique<ScenesRecallScene>(),
        make_unique<ScenesRemoveAllScenes>(),  make_unique<ScenesRemoveScene>(),         make_unique<ScenesStoreScene>(),
        make_unique<ScenesViewScene>(),        make_unique<DiscoverScenesAttributes>(),  make_unique<ReadScenesSceneCount>(),
        make_unique<ReadScenesCurrentScene>(), make_unique<ReadScenesCurrentGroup>(),    make_unique<ReadScenesSceneValid>(),
        make_unique<ReadScenesNameSupport>(),  make_unique<ReadScenesClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterSoftwareDiagnostics(Commands & commands)
{
    const char * clusterName = "SoftwareDiagnostics";

    commands_list clusterCommands = {
        make_unique<SoftwareDiagnosticsResetWatermarks>(),
        make_unique<DiscoverSoftwareDiagnosticsAttributes>(),
        make_unique<ReadSoftwareDiagnosticsCurrentHeapHighWatermark>(),
        make_unique<ReadSoftwareDiagnosticsClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterSwitch(Commands & commands)
{
    const char * clusterName = "Switch";

    commands_list clusterCommands = {
        make_unique<DiscoverSwitchAttributes>(),  make_unique<ReadSwitchNumberOfPositions>(),
        make_unique<ReadSwitchCurrentPosition>(), make_unique<ReportSwitchCurrentPosition>(),
        make_unique<ReadSwitchClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterTvChannel(Commands & commands)
{
    const char * clusterName = "TvChannel";

    commands_list clusterCommands = {
        make_unique<TvChannelChangeChannel>(),        make_unique<TvChannelChangeChannelByNumber>(),
        make_unique<TvChannelSkipChannel>(),          make_unique<DiscoverTvChannelAttributes>(),
        make_unique<ReadTvChannelTvChannelList>(),    make_unique<ReadTvChannelTvChannelLineup>(),
        make_unique<ReadTvChannelCurrentTvChannel>(), make_unique<ReadTvChannelClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterTargetNavigator(Commands & commands)
{
    const char * clusterName = "TargetNavigator";

    commands_list clusterCommands = {
        make_unique<TargetNavigatorNavigateTarget>(),
        make_unique<DiscoverTargetNavigatorAttributes>(),
        make_unique<ReadTargetNavigatorTargetNavigatorList>(),
        make_unique<ReadTargetNavigatorClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterTemperatureMeasurement(Commands & commands)
{
    const char * clusterName = "TemperatureMeasurement";

    commands_list clusterCommands = {
        make_unique<DiscoverTemperatureMeasurementAttributes>(),   make_unique<ReadTemperatureMeasurementMeasuredValue>(),
        make_unique<ReportTemperatureMeasurementMeasuredValue>(),  make_unique<ReadTemperatureMeasurementMinMeasuredValue>(),
        make_unique<ReadTemperatureMeasurementMaxMeasuredValue>(), make_unique<ReadTemperatureMeasurementClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterTestCluster(Commands & commands)
{
    const char * clusterName = "TestCluster";

    commands_list clusterCommands = {
        make_unique<TestClusterTest>(),
        make_unique<TestClusterTestNotHandled>(),
        make_unique<TestClusterTestSpecific>(),
        make_unique<TestClusterTestUnknownCommand>(),
        make_unique<DiscoverTestClusterAttributes>(),
        make_unique<ReadTestClusterBoolean>(),
        make_unique<WriteTestClusterBoolean>(),
        make_unique<ReadTestClusterBitmap8>(),
        make_unique<WriteTestClusterBitmap8>(),
        make_unique<ReadTestClusterBitmap16>(),
        make_unique<WriteTestClusterBitmap16>(),
        make_unique<ReadTestClusterBitmap32>(),
        make_unique<WriteTestClusterBitmap32>(),
        make_unique<ReadTestClusterBitmap64>(),
        make_unique<WriteTestClusterBitmap64>(),
        make_unique<ReadTestClusterInt8u>(),
        make_unique<WriteTestClusterInt8u>(),
        make_unique<ReadTestClusterInt16u>(),
        make_unique<WriteTestClusterInt16u>(),
        make_unique<ReadTestClusterInt32u>(),
        make_unique<WriteTestClusterInt32u>(),
        make_unique<ReadTestClusterInt64u>(),
        make_unique<WriteTestClusterInt64u>(),
        make_unique<ReadTestClusterInt8s>(),
        make_unique<WriteTestClusterInt8s>(),
        make_unique<ReadTestClusterInt16s>(),
        make_unique<WriteTestClusterInt16s>(),
        make_unique<ReadTestClusterInt32s>(),
        make_unique<WriteTestClusterInt32s>(),
        make_unique<ReadTestClusterInt64s>(),
        make_unique<WriteTestClusterInt64s>(),
        make_unique<ReadTestClusterEnum8>(),
        make_unique<WriteTestClusterEnum8>(),
        make_unique<ReadTestClusterEnum16>(),
        make_unique<WriteTestClusterEnum16>(),
        make_unique<ReadTestClusterOctetString>(),
        make_unique<WriteTestClusterOctetString>(),
        make_unique<ReadTestClusterListInt8u>(),
        make_unique<ReadTestClusterListOctetString>(),
        make_unique<ReadTestClusterListStructOctetString>(),
        make_unique<ReadTestClusterLongOctetString>(),
        make_unique<WriteTestClusterLongOctetString>(),
        make_unique<ReadTestClusterCharString>(),
        make_unique<WriteTestClusterCharString>(),
        make_unique<ReadTestClusterLongCharString>(),
        make_unique<WriteTestClusterLongCharString>(),
        make_unique<ReadTestClusterUnsupported>(),
        make_unique<WriteTestClusterUnsupported>(),
        make_unique<ReadTestClusterClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterThermostat(Commands & commands)
{
    const char * clusterName = "Thermostat";

    commands_list clusterCommands = {
        make_unique<ThermostatClearWeeklySchedule>(),
        make_unique<ThermostatGetRelayStatusLog>(),
        make_unique<ThermostatGetWeeklySchedule>(),
        make_unique<ThermostatSetWeeklySchedule>(),
        make_unique<ThermostatSetpointRaiseLower>(),
        make_unique<DiscoverThermostatAttributes>(),
        make_unique<ReadThermostatLocalTemperature>(),
        make_unique<ReportThermostatLocalTemperature>(),
        make_unique<ReadThermostatOccupiedCoolingSetpoint>(),
        make_unique<WriteThermostatOccupiedCoolingSetpoint>(),
        make_unique<ReadThermostatOccupiedHeatingSetpoint>(),
        make_unique<WriteThermostatOccupiedHeatingSetpoint>(),
        make_unique<ReadThermostatControlSequenceOfOperation>(),
        make_unique<WriteThermostatControlSequenceOfOperation>(),
        make_unique<ReadThermostatSystemMode>(),
        make_unique<WriteThermostatSystemMode>(),
        make_unique<ReadThermostatStartOfWeek>(),
        make_unique<ReadThermostatNumberOfWeeklyTransitions>(),
        make_unique<ReadThermostatNumberOfDailyTransitions>(),
        make_unique<ReadThermostatFeatureMap>(),
        make_unique<ReadThermostatClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterThreadNetworkDiagnostics(Commands & commands)
{
    const char * clusterName = "ThreadNetworkDiagnostics";

    commands_list clusterCommands = {
        make_unique<ThreadNetworkDiagnosticsResetCounts>(),
        make_unique<DiscoverThreadNetworkDiagnosticsAttributes>(),
        make_unique<ReadThreadNetworkDiagnosticsChannel>(),
        make_unique<ReadThreadNetworkDiagnosticsRoutingRole>(),
        make_unique<ReadThreadNetworkDiagnosticsNetworkName>(),
        make_unique<ReadThreadNetworkDiagnosticsPanId>(),
        make_unique<ReadThreadNetworkDiagnosticsExtendedPanId>(),
        make_unique<ReadThreadNetworkDiagnosticsMeshLocalPrefix>(),
        make_unique<ReadThreadNetworkDiagnosticsOverrunCount>(),
        make_unique<ReadThreadNetworkDiagnosticsNeighborTableList>(),
        make_unique<ReadThreadNetworkDiagnosticsRouteTableList>(),
        make_unique<ReadThreadNetworkDiagnosticsPartitionId>(),
        make_unique<ReadThreadNetworkDiagnosticsWeighting>(),
        make_unique<ReadThreadNetworkDiagnosticsDataVersion>(),
        make_unique<ReadThreadNetworkDiagnosticsStableDataVersion>(),
        make_unique<ReadThreadNetworkDiagnosticsLeaderRouterId>(),
        make_unique<ReadThreadNetworkDiagnosticsDetachedRoleCount>(),
        make_unique<ReadThreadNetworkDiagnosticsChildRoleCount>(),
        make_unique<ReadThreadNetworkDiagnosticsRouterRoleCount>(),
        make_unique<ReadThreadNetworkDiagnosticsLeaderRoleCount>(),
        make_unique<ReadThreadNetworkDiagnosticsAttachAttemptCount>(),
        make_unique<ReadThreadNetworkDiagnosticsPartitionIdChangeCount>(),
        make_unique<ReadThreadNetworkDiagnosticsBetterPartitionAttachAttemptCount>(),
        make_unique<ReadThreadNetworkDiagnosticsParentChangeCount>(),
        make_unique<ReadThreadNetworkDiagnosticsTxTotalCount>(),
        make_unique<ReadThreadNetworkDiagnosticsTxUnicastCount>(),
        make_unique<ReadThreadNetworkDiagnosticsTxBroadcastCount>(),
        make_unique<ReadThreadNetworkDiagnosticsTxAckRequestedCount>(),
        make_unique<ReadThreadNetworkDiagnosticsTxAckedCount>(),
        make_unique<ReadThreadNetworkDiagnosticsTxNoAckRequestedCount>(),
        make_unique<ReadThreadNetworkDiagnosticsTxDataCount>(),
        make_unique<ReadThreadNetworkDiagnosticsTxDataPollCount>(),
        make_unique<ReadThreadNetworkDiagnosticsTxBeaconCount>(),
        make_unique<ReadThreadNetworkDiagnosticsTxBeaconRequestCount>(),
        make_unique<ReadThreadNetworkDiagnosticsTxOtherCount>(),
        make_unique<ReadThreadNetworkDiagnosticsTxRetryCount>(),
        make_unique<ReadThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCount>(),
        make_unique<ReadThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCount>(),
        make_unique<ReadThreadNetworkDiagnosticsTxErrCcaCount>(),
        make_unique<ReadThreadNetworkDiagnosticsTxErrAbortCount>(),
        make_unique<ReadThreadNetworkDiagnosticsTxErrBusyChannelCount>(),
        make_unique<ReadThreadNetworkDiagnosticsRxTotalCount>(),
        make_unique<ReadThreadNetworkDiagnosticsRxUnicastCount>(),
        make_unique<ReadThreadNetworkDiagnosticsRxBroadcastCount>(),
        make_unique<ReadThreadNetworkDiagnosticsRxDataCount>(),
        make_unique<ReadThreadNetworkDiagnosticsRxDataPollCount>(),
        make_unique<ReadThreadNetworkDiagnosticsRxBeaconCount>(),
        make_unique<ReadThreadNetworkDiagnosticsRxBeaconRequestCount>(),
        make_unique<ReadThreadNetworkDiagnosticsRxOtherCount>(),
        make_unique<ReadThreadNetworkDiagnosticsRxAddressFilteredCount>(),
        make_unique<ReadThreadNetworkDiagnosticsRxDestAddrFilteredCount>(),
        make_unique<ReadThreadNetworkDiagnosticsRxDuplicatedCount>(),
        make_unique<ReadThreadNetworkDiagnosticsRxErrNoFrameCount>(),
        make_unique<ReadThreadNetworkDiagnosticsRxErrUnknownNeighborCount>(),
        make_unique<ReadThreadNetworkDiagnosticsRxErrInvalidSrcAddrCount>(),
        make_unique<ReadThreadNetworkDiagnosticsRxErrSecCount>(),
        make_unique<ReadThreadNetworkDiagnosticsRxErrFcsCount>(),
        make_unique<ReadThreadNetworkDiagnosticsRxErrOtherCount>(),
        make_unique<ReadThreadNetworkDiagnosticsSecurityPolicy>(),
        make_unique<ReadThreadNetworkDiagnosticsChannelMask>(),
        make_unique<ReadThreadNetworkDiagnosticsOperationalDatasetComponents>(),
        make_unique<ReadThreadNetworkDiagnosticsActiveNetworkFaultsList>(),
        make_unique<ReadThreadNetworkDiagnosticsClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterWakeOnLan(Commands & commands)
{
    const char * clusterName = "WakeOnLan";

    commands_list clusterCommands = {
        make_unique<DiscoverWakeOnLanAttributes>(),
        make_unique<ReadWakeOnLanWakeOnLanMacAddress>(),
        make_unique<ReadWakeOnLanClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterWiFiNetworkDiagnostics(Commands & commands)
{
    const char * clusterName = "WiFiNetworkDiagnostics";

    commands_list clusterCommands = {
        make_unique<WiFiNetworkDiagnosticsResetCounts>(),     make_unique<DiscoverWiFiNetworkDiagnosticsAttributes>(),
        make_unique<ReadWiFiNetworkDiagnosticsBssid>(),       make_unique<ReadWiFiNetworkDiagnosticsSecurityType>(),
        make_unique<ReadWiFiNetworkDiagnosticsWiFiVersion>(), make_unique<ReadWiFiNetworkDiagnosticsChannelNumber>(),
        make_unique<ReadWiFiNetworkDiagnosticsRssi>(),        make_unique<ReadWiFiNetworkDiagnosticsClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterWindowCovering(Commands & commands)
{
    const char * clusterName = "WindowCovering";

    commands_list clusterCommands = {
        make_unique<WindowCoveringDownOrClose>(),
        make_unique<WindowCoveringGoToLiftPercentage>(),
        make_unique<WindowCoveringGoToLiftValue>(),
        make_unique<WindowCoveringGoToTiltPercentage>(),
        make_unique<WindowCoveringGoToTiltValue>(),
        make_unique<WindowCoveringStopMotion>(),
        make_unique<WindowCoveringUpOrOpen>(),
        make_unique<DiscoverWindowCoveringAttributes>(),
        make_unique<ReadWindowCoveringType>(),
        make_unique<ReadWindowCoveringCurrentPositionLift>(),
        make_unique<ReadWindowCoveringCurrentPositionTilt>(),
        make_unique<ReadWindowCoveringConfigStatus>(),
        make_unique<ReadWindowCoveringCurrentPositionLiftPercentage>(),
        make_unique<ReportWindowCoveringCurrentPositionLiftPercentage>(),
        make_unique<ReadWindowCoveringCurrentPositionTiltPercentage>(),
        make_unique<ReportWindowCoveringCurrentPositionTiltPercentage>(),
        make_unique<ReadWindowCoveringOperationalStatus>(),
        make_unique<ReportWindowCoveringOperationalStatus>(),
        make_unique<ReadWindowCoveringTargetPositionLiftPercent100ths>(),
        make_unique<ReportWindowCoveringTargetPositionLiftPercent100ths>(),
        make_unique<ReadWindowCoveringTargetPositionTiltPercent100ths>(),
        make_unique<ReportWindowCoveringTargetPositionTiltPercent100ths>(),
        make_unique<ReadWindowCoveringEndProductType>(),
        make_unique<ReadWindowCoveringCurrentPositionLiftPercent100ths>(),
        make_unique<ReportWindowCoveringCurrentPositionLiftPercent100ths>(),
        make_unique<ReadWindowCoveringCurrentPositionTiltPercent100ths>(),
        make_unique<ReportWindowCoveringCurrentPositionTiltPercent100ths>(),
        make_unique<ReadWindowCoveringInstalledOpenLimitLift>(),
        make_unique<ReadWindowCoveringInstalledClosedLimitLift>(),
        make_unique<ReadWindowCoveringInstalledOpenLimitTilt>(),
        make_unique<ReadWindowCoveringInstalledClosedLimitTilt>(),
        make_unique<ReadWindowCoveringMode>(),
        make_unique<WriteWindowCoveringMode>(),
        make_unique<ReadWindowCoveringSafetyStatus>(),
        make_unique<ReportWindowCoveringSafetyStatus>(),
        make_unique<ReadWindowCoveringClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}

void registerClusters(Commands & commands)
{
    registerClusterAccountLogin(commands);
    registerClusterApplicationBasic(commands);
    registerClusterApplicationLauncher(commands);
    registerClusterAudioOutput(commands);
    registerClusterBarrierControl(commands);
    registerClusterBasic(commands);
    registerClusterBinaryInputBasic(commands);
    registerClusterBinding(commands);
    registerClusterBridgedDeviceBasic(commands);
    registerClusterColorControl(commands);
    registerClusterContentLauncher(commands);
    registerClusterDescriptor(commands);
    registerClusterDiagnosticLogs(commands);
    registerClusterDoorLock(commands);
    registerClusterElectricalMeasurement(commands);
    registerClusterEthernetNetworkDiagnostics(commands);
    registerClusterFixedLabel(commands);
    registerClusterFlowMeasurement(commands);
    registerClusterGeneralCommissioning(commands);
    registerClusterGeneralDiagnostics(commands);
    registerClusterGroupKeyManagement(commands);
    registerClusterGroups(commands);
    registerClusterIdentify(commands);
    registerClusterKeypadInput(commands);
    registerClusterLevelControl(commands);
    registerClusterLowPower(commands);
    registerClusterMediaInput(commands);
    registerClusterMediaPlayback(commands);
    registerClusterNetworkCommissioning(commands);
    registerClusterOtaSoftwareUpdateProvider(commands);
    registerClusterOccupancySensing(commands);
    registerClusterOnOff(commands);
    registerClusterOperationalCredentials(commands);
    registerClusterPressureMeasurement(commands);
    registerClusterPumpConfigurationAndControl(commands);
    registerClusterRelativeHumidityMeasurement(commands);
    registerClusterScenes(commands);
    registerClusterSoftwareDiagnostics(commands);
    registerClusterSwitch(commands);
    registerClusterTvChannel(commands);
    registerClusterTargetNavigator(commands);
    registerClusterTemperatureMeasurement(commands);
    registerClusterTestCluster(commands);
    registerClusterThermostat(commands);
    registerClusterThreadNetworkDiagnostics(commands);
    registerClusterWakeOnLan(commands);
    registerClusterWiFiNetworkDiagnostics(commands);
    registerClusterWindowCovering(commands);
}
